0a3ac591e6
* Use button gradient only on hover * Apply hover effect to main window buttons * Apply arbitrary change to force recreation of colors.py * Undo arbitrary change to fix props not being created * Remember that the comments are used for regex matching * Yet another try * Revert "Yet another try" This reverts commit eaef4805c1618cf93ac2f93bc14ada900dc6d155. * Update _root-vars.scss
122 lines
3.0 KiB
SCSS
122 lines
3.0 KiB
SCSS
/* Copyright: Ankitects Pty Ltd and contributors
|
|
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
|
@use "vars";
|
|
@use "sass:color";
|
|
@use "sass/elevation" as *;
|
|
|
|
@import "bootstrap/scss/functions";
|
|
@import "bootstrap/scss/variables";
|
|
|
|
@mixin impressed-shadow($intensity) {
|
|
box-shadow: inset 0 calc(var(--buttons-size, 10px) / 15)
|
|
calc(var(--buttons-size, 10px) / 5) rgba(black, $intensity);
|
|
}
|
|
|
|
@mixin 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);
|
|
}
|
|
|
|
@mixin background($primary: false, $hover: true) {
|
|
@if $primary {
|
|
background: var(--button-primary-bg);
|
|
@if $hover {
|
|
&:hover {
|
|
background: linear-gradient(
|
|
180deg,
|
|
var(--button-primary-gradient-start) 0%,
|
|
var(--button-primary-gradient-end) 100%
|
|
);
|
|
border-color: var(--button-hover-border);
|
|
}
|
|
}
|
|
} @else {
|
|
background: var(--button-bg);
|
|
@if $hover {
|
|
&:hover {
|
|
background: linear-gradient(
|
|
180deg,
|
|
var(--button-gradient-start) 0%,
|
|
var(--button-gradient-end) 100%
|
|
);
|
|
border-color: var(--button-hover-border);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@mixin base(
|
|
$primary: false,
|
|
$border: true,
|
|
$with-hover: true,
|
|
$with-active: true,
|
|
$active-class: "",
|
|
$with-disabled: true
|
|
) {
|
|
-webkit-appearance: none;
|
|
cursor: pointer;
|
|
@if $border {
|
|
@if $primary {
|
|
border: none;
|
|
} @else {
|
|
border: 1px solid var(--border-subtle);
|
|
border-bottom-color: var(--shadow);
|
|
}
|
|
} @else {
|
|
border: none;
|
|
}
|
|
@include background($primary, $hover: $with-hover);
|
|
|
|
@if ($primary) {
|
|
color: white;
|
|
} @else {
|
|
color: var(--fg);
|
|
}
|
|
|
|
@if ($with-active) {
|
|
&:active {
|
|
@include impressed-shadow(0.35);
|
|
border-color: var(--border-subtle);
|
|
}
|
|
@if ($active-class != "") {
|
|
&.#{$active-class} {
|
|
@include impressed-shadow(0.35);
|
|
border-color: var(--border);
|
|
}
|
|
}
|
|
}
|
|
|
|
@if ($with-disabled) {
|
|
&[disabled],
|
|
&[disabled]:hover {
|
|
cursor: not-allowed;
|
|
color: var(--fg-disabled);
|
|
box-shadow: none !important;
|
|
background-color: var(--button-gradient-end);
|
|
border-bottom-color: var(--border-subtle);
|
|
}
|
|
}
|
|
}
|
|
|
|
$focus-color: var(--shadow-focus);
|
|
|
|
@mixin select($with-disabled: true) {
|
|
width: 100%;
|
|
white-space: nowrap;
|
|
text-overflow: ellipsis;
|
|
|
|
pointer-events: all;
|
|
cursor: pointer;
|
|
|
|
@include base($with-disabled: $with-disabled);
|
|
|
|
border-radius: var(--border-radius);
|
|
|
|
&.rtl {
|
|
direction: rtl;
|
|
}
|
|
}
|