/* Copyright: Ankitects Pty Ltd and contributors * License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */ @use "fusion-vars"; @use "sass:color"; @import "bootstrap/scss/functions"; @import "bootstrap/scss/variables"; @mixin impressed-shadow($intensity) { box-shadow: inset 0 calc(var(--buttons-size) / 15) calc(var(--buttons-size) / 5) rgba(black, $intensity); } @mixin btn-border-radius { border-top-left-radius: var(--border-left-radius); border-bottom-left-radius: var(--border-left-radius); border-top-right-radius: var(--border-right-radius); border-bottom-right-radius: var(--border-right-radius); } $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-hover: true, $with-active: true, $with-disabled: true) { .btn-day { @include btn-day-base; @content ($btn-base-color-day); @if ($with-hover) { &:hover, &.hover { background-color: color.scale($btn-base-color-day, $lightness: -20%); } } @if ($with-active) { &: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: fusion-vars.$button-border; @mixin btn-night-base { color: var(--text-fg); background: linear-gradient( 180deg, fusion-vars.$button-gradient-start 0%, fusion-vars.$button-gradient-end 100% ); } @mixin btn-night($with-hover: true, $with-active: true, $with-disabled: true) { .btn-night { @include btn-night-base; @content ($btn-base-color-night); border: 1px solid fusion-vars.$button-border; -webkit-appearance: none; @if ($with-hover) { &:hover, &.hover { background: linear-gradient( 180deg, color.scale(fusion-vars.$button-gradient-start, $lightness: 20%) 0%, color.scale(fusion-vars.$button-gradient-end, $lightness: 20%) 100% ); border-color: color.scale(fusion-vars.$button-border, $lightness: 20%); } } @if ($with-active) { &:active, &.active { @include impressed-shadow(0.35); border-color: color.scale($btn-base-color-night, $lightness: -20%); } &: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: rgba(21 97 174); @function down-arrow($color) { @return url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='transparent' stroke='#{$color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); }