Files
mixtape/zero.Web/Sass/Modules/Buttons/_button.scss
T

257 lines
3.8 KiB
SCSS
Raw Normal View History

2020-03-26 22:14:16 +01:00
2020-03-27 01:17:22 +01:00
button
{
@extend %font;
2020-04-06 18:45:23 +02:00
color: var(--color-fg);
2020-04-07 14:47:57 +02:00
outline: 0 solid transparent !important;
display: inline-block;
2020-03-27 01:17:22 +01:00
2020-04-07 13:18:19 +02:00
&:visited, &:link
2020-03-27 01:17:22 +01:00
{
2020-04-07 13:18:19 +02:00
text-decoration: none;
}
&:focus, &:active
{
2020-04-07 14:47:57 +02:00
outline: 0 solid transparent !important;
2020-03-27 01:17:22 +01:00
}
}
2020-04-07 14:47:57 +02:00
button::-moz-focus-inner
{
border: 0;
}
2020-03-27 01:17:22 +01:00
.ui-button
{
2020-04-09 13:06:15 +02:00
position: relative;
2020-03-30 17:46:29 +02:00
display: inline-flex;
justify-content: space-between;
align-items: center;
2020-04-07 00:11:35 +02:00
color: var(--color-primary-fg);
2020-03-27 01:17:22 +01:00
background: var(--color-primary);
2020-04-10 18:36:56 +02:00
padding: 0 20px;
2020-04-03 18:03:36 +02:00
height: 42px;
2020-03-27 01:17:22 +01:00
border-radius: 3px;
font-size: 14px;
2020-04-03 18:03:36 +02:00
font-weight: 700;
2020-03-27 01:17:22 +01:00
margin: 0;
-webkit-backface-visibility: hidden;
-webkit-appearance: none;
cursor: pointer;
user-select: none;
border: none;
will-change: transform, background, border-color;
transition: background .2s, transform .2s, opacity .2s;
overflow: hidden;
2020-04-07 14:47:57 +02:00
outline: 0 solid transparent !important;
2020-03-27 01:17:22 +01:00
@extend %font;
&:hover
{
opacity: 0.9;
}
2020-04-07 13:18:19 +02:00
&:focus, &:active
{
outline: none !important;
}
2020-03-27 01:17:22 +01:00
&:active
{
opacity: 1;
}
&.is-disabled, &[disabled]
{
pointer-events: none;
//background: var(--color-dark);
}
2020-03-30 17:11:56 +02:00
&.type-outline
{
2020-04-03 18:03:36 +02:00
height: 43px;
2020-04-09 13:06:15 +02:00
background: var(--color-box);
2020-03-30 17:11:56 +02:00
color: var(--color-fg);
border: 1px solid var(--color-line);
box-sizing: border-box;
position: relative;
top: 1px;
}
2020-04-03 14:27:39 +02:00
&.type-big
{
height: 50px;
padding: 0 30px;
}
2020-04-07 00:11:35 +02:00
&.type-light
{
background: var(--color-bg-mid);
color: var(--color-fg);
border: none;
}
2020-04-10 18:36:56 +02:00
&.type-white
{
background: var(--color-box);
color: var(--color-fg);
border: none;
box-shadow: var(--color-shadow-short);
}
2020-04-09 13:06:15 +02:00
&.type-blank
{
background: transparent;
color: var(--color-fg);
border: none;
2020-04-09 19:35:57 +02:00
padding: 0 16px;
2020-04-09 13:06:15 +02:00
}
&.type-block
{
display: flex;
width: 100%;
}
2020-03-30 17:11:56 +02:00
& + .ui-button
{
2020-04-07 00:11:35 +02:00
margin-left: 15px;
2020-03-30 17:11:56 +02:00
}
2020-03-30 17:46:29 +02:00
2020-04-09 13:06:15 +02:00
.ui-button-icon, .ui-button-caret
2020-03-30 17:46:29 +02:00
{
2020-04-10 19:17:37 +02:00
margin-left: 18px;
margin-right: -3px;
2020-03-30 17:46:29 +02:00
position: relative;
2020-04-07 00:11:35 +02:00
font-size: var(--font-size-l);
2020-03-30 17:46:29 +02:00
top: -1px;
2020-04-10 19:17:37 +02:00
/*color: var(--color-fg-mid);*/
2020-03-30 17:46:29 +02:00
}
&.caret-left
{
flex-direction: row-reverse;
2020-04-09 13:06:15 +02:00
.ui-button-icon, .ui-button-caret
2020-03-30 17:46:29 +02:00
{
margin-right: 12px;
margin-left: -7px;
}
}
2020-04-09 15:53:03 +02:00
&.has-ellipsis .ui-button-text:after
{
content: '...';
}
2020-03-27 01:17:22 +01:00
}
2020-04-09 13:06:15 +02:00
.ui-button-state
{
position: absolute;
left: 50%;
top: 50%;
display: flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
margin-left: -8px;
margin-top: -8px;
text-align: center;
}
.ui-button-progress
{
width: 100%;
height: 100%;
z-index: 2;
border-radius: 40px;
border: 2px solid var(--color-fg-mid);
border-left-color: var(--color-bg);
opacity: 1;
will-change: transform;
animation: rotating .5s linear infinite;
transition: opacity .25s ease;
.type-light &, .type-blank &
{
border-color: var(--color-bg-mid);
border-left-color: var(--color-fg);
}
}
@keyframes rotating
{
from
{
-webkit-transform: rotate(0);
transform: rotate(0)
}
to
{
-webkit-transform: rotate(1turn);
transform: rotate(1turn)
}
}
// states
2020-04-09 15:53:03 +02:00
.ui-button.has-state:not(.state-default)
2020-04-09 13:06:15 +02:00
{
> :not(.ui-button-state)
{
visibility: hidden;
}
}
2020-03-26 22:14:16 +01:00
2020-04-06 23:48:28 +02:00
.ui-dot-button
{
@extend .ui-button;
background: transparent;
padding: 0;
height: 28px;
width: 36px;
text-align: center;
justify-content: center;
font-size: var(--font-size-xl);
&:hover
{
2020-04-09 15:53:03 +02:00
background: var(--color-bg-mid);
2020-04-06 23:48:28 +02:00
}
2020-04-09 15:53:03 +02:00
.ui-button-icon
2020-04-06 23:48:28 +02:00
{
margin: 0;
}
}
2020-04-07 00:11:35 +02:00
.ui-icon-button
{
@extend .ui-button;
background: var(--color-bg-mid);
padding: 0;
height: 32px;
width: 32px;
border-radius: 16px;
text-align: center;
justify-content: center;
font-size: var(--font-size-l);
&:hover
{
opacity: 1;
}
2020-04-09 15:53:03 +02:00
.ui-button-icon
2020-04-07 00:11:35 +02:00
{
color: var(--color-fg);
margin: 0;
top: 0;
}
2020-04-09 15:53:03 +02:00
}