papercss/src/components/_buttons.scss

116 lines
2.6 KiB
SCSS
Raw Permalink Normal View History

2017-12-19 17:52:52 +01:00
button,
.paper-btn,
2018-05-24 14:13:53 +02:00
[type='button'] {
@include border-style();
@include shadow();
@include transition();
2020-06-01 23:02:51 +02:00
@include color('color', 'primary');
@include color('border-color', 'primary');
@include color('background-color', 'main-background');
2017-12-19 17:52:52 +01:00
align-self: center;
2020-06-01 23:02:51 +02:00
background-image: none;
2020-09-07 02:11:51 +02:00
border-style: solid;
border-width: 2px;
2018-05-24 14:13:53 +02:00
cursor: pointer;
display: inline-block;
2017-12-19 17:52:52 +01:00
font-size: 1rem;
2018-05-24 14:13:53 +02:00
outline: none;
padding: 0.75rem;
2017-12-19 18:03:47 +01:00
2017-12-23 09:43:23 +01:00
@include resp(520px) {
display: inline-block;
2017-12-23 09:43:23 +01:00
margin: 0 auto;
margin-bottom: 1rem;
2018-05-24 14:13:53 +02:00
text-align: center;
2017-12-23 09:43:23 +01:00
}
2017-12-19 17:52:52 +01:00
&.btn-large {
@include shadow(large);
font-size: 2rem;
2018-05-24 14:13:53 +02:00
padding: 1rem;
2017-12-19 17:52:52 +01:00
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&.btn-small {
@include shadow(small);
2018-05-24 14:13:53 +02:00
font-size: 0.75rem;
padding: 0.5rem;
2017-12-19 17:52:52 +01:00
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&.btn-block {
display: block;
width: 100%;
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&:hover {
@include shadow(hover);
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&:focus {
2020-08-26 00:40:03 +02:00
@include color('border-color', 'secondary');
2020-09-07 02:11:51 +02:00
border-style: solid;
border-width: 2px;
2018-05-24 14:13:53 +02:00
box-shadow: 2px 8px 4px -6px hsla(0, 0%, 0%, 0.3);
2017-12-19 17:52:52 +01:00
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&:active {
2018-05-24 14:13:53 +02:00
border-color: hsla(0, 0%, 0%, 0.2);
2017-12-19 17:52:52 +01:00
transition: none;
}
2017-12-19 18:03:47 +01:00
2017-12-19 17:52:52 +01:00
&.disabled,
&[disabled] {
2017-12-23 09:43:23 +01:00
cursor: not-allowed;
2018-05-24 14:13:53 +02:00
opacity: 0.5;
2017-12-19 17:52:52 +01:00
}
2017-09-27 23:10:41 +02:00
}
a {
2020-09-07 02:27:55 +02:00
@include color('color', 'secondary');
2020-09-07 02:11:51 +02:00
background-image: linear-gradient(5deg, transparent 65%, $secondary 80%, transparent 90%), linear-gradient(165deg, transparent 5%, $secondary 15%, transparent 25%), linear-gradient(165deg, transparent 45%, $secondary 55%, transparent 65%), linear-gradient(15deg, transparent 25%, $secondary 35%, transparent 50%);
2018-05-24 14:13:53 +02:00
background-position: 0 90%;
2017-12-19 17:52:52 +01:00
background-repeat: repeat-x;
background-size: 4px 3px;
2018-05-24 14:13:53 +02:00
text-decoration: none;
2017-12-19 17:52:52 +01:00
&:visited {
2020-06-01 23:02:51 +02:00
@include color('color', 'primary');
2018-05-24 14:13:53 +02:00
text-decoration: none;
2017-12-19 17:52:52 +01:00
}
}
2017-12-19 17:52:33 +01:00
@each $colorName, $color, $color-light, $color-text in $colors {
2018-05-24 14:13:53 +02:00
button.btn-#{$colorName},
.paper-btn.btn-#{$colorName},
[type='button'].btn-#{$colorName} {
2020-08-26 00:40:03 +02:00
@include color('color', #{$colorName}-text);
@include color('background-color', #{$colorName}-light);
@include color('border-color', #{$colorName});
2018-05-24 14:13:53 +02:00
&:hover {
2017-12-19 17:52:52 +01:00
&:active {
background-color: darken($color-light, 10%);
}
}
2017-12-19 17:52:33 +01:00
}
}
2019-01-30 12:36:11 +01:00
2019-02-01 17:36:54 +01:00
@each $colorName, $color, $color-light, $color-text in $colors {
button.btn-#{$colorName}-outline,
.paper-btn.btn-#{$colorName}-outline,
[type='button'].btn-#{$colorName}-outline {
@include color('background-color', main-background);
@include color('color', #{$colorName});
@include color('border-color', #{$colorName});
2019-01-30 12:36:11 +01:00
&:hover {
background-color: $color-light;
}
&:hover {
&:active {
background-color: darken($color-light, 10%);
}
}
}
}