anki/ts/sass/button_mixins.scss
2021-04-16 19:00:36 +02:00

95 lines
2.4 KiB
SCSS

@import "ts/sass/bootstrap/functions";
@import "ts/sass/bootstrap/variables";
$btn-base-color-day: white;
@mixin btn-day-base {
color: var(--text-fg);
background-color: $btn-base-color-day;
border-color: var(--medium-border) !important;
}
@mixin btn-day($with-disabled: true) {
.btn-day {
@include btn-day-base;
@content ($btn-base-color-day);
&:hover {
background-color: darken($btn-base-color-day, 8%);
}
&:active,
&.active {
@include impressed-shadow(0.25);
}
&:active.active {
box-shadow: none;
}
@if ($with-disabled) {
&[disabled] {
background-color: $btn-base-color-day !important;
box-shadow: none !important;
}
}
}
}
$btn-base-color-night: #666;
@mixin btn-night-base {
color: var(--text-fg);
background-color: $btn-base-color-night;
border-color: $btn-base-color-night;
}
@mixin btn-night($with-disabled: true) {
.btn-night {
@include btn-night-base;
@content ($btn-base-color-night);
&:hover {
background-color: lighten($btn-base-color-night, 8%);
border-color: lighten($btn-base-color-night, 8%);
}
&:active,
&.active {
@include impressed-shadow(0.35);
border-color: darken($btn-base-color-night, 8%);
}
&:active.active {
box-shadow: none;
border-color: $btn-base-color-night;
}
@if ($with-disabled) {
&[disabled] {
background-color: $btn-base-color-night !important;
box-shadow: none !important;
border-color: $btn-base-color-night !important;
}
}
}
}
// should be similar to -webkit-focus-ring-color
$focus-color: $blue;
@mixin impressed-shadow($intensity) {
box-shadow: inset 0 calc(var(--toolbar-size) / 15) calc(var(--toolbar-size) / 5)
rgba(black, $intensity);
}
@mixin rainbow($base) {
background: content-box
linear-gradient(217deg, rgba(255, 0, 0, 0.8), rgba(255, 0, 0, 0) 70.71%),
content-box
linear-gradient(127deg, rgba(0, 255, 0, 0.8), rgba(0, 255, 0, 0) 70.71%),
content-box
linear-gradient(336deg, rgba(0, 0, 255, 0.8), rgba(0, 0, 255, 0) 70.71%),
border-box $base;
}