mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-22 09:32:38 +00:00
refactor: make the whole thing more generic
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
@import "./button";
|
||||
|
||||
@mixin accs-button($flat: false, $reactive: true) {
|
||||
@include button($flat: true, $reactive: false, $focusable: false);
|
||||
color: $fg-color;
|
||||
|
||||
> * {
|
||||
border-radius: $radii;
|
||||
transition: $transition;
|
||||
|
||||
@if $flat {
|
||||
background-color: transparent;
|
||||
box-shadow: none;
|
||||
} @else {
|
||||
background-color: $widget-bg;
|
||||
box-shadow: inset 0 0 0 $border-width $border-color;
|
||||
}
|
||||
}
|
||||
|
||||
@if $reactive {
|
||||
&:focus > *,
|
||||
&.focused > * {
|
||||
@include button-focus;
|
||||
}
|
||||
|
||||
&:hover > * {
|
||||
@include button-hover;
|
||||
}
|
||||
|
||||
&:active,
|
||||
&.active,
|
||||
&.on,
|
||||
&:checked {
|
||||
> * {
|
||||
@include button-active;
|
||||
}
|
||||
|
||||
&:hover > * {
|
||||
box-shadow:
|
||||
inset 0 0 0 $border-width $border-color,
|
||||
inset 0 0 0 99px $hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
@mixin button-focus() {
|
||||
box-shadow: inset 0 0 0 $border-width $accent;
|
||||
background-color: $hover;
|
||||
color: $hover-fg;
|
||||
}
|
||||
|
||||
@mixin button-hover() {
|
||||
box-shadow: inset 0 0 0 $border-width $border-color;
|
||||
background-color: $hover;
|
||||
color: $hover-fg;
|
||||
}
|
||||
|
||||
@mixin button-active() {
|
||||
box-shadow: inset 0 0 0 $border-width $border-color;
|
||||
background-image: $active-gradient;
|
||||
background-color: $accent;
|
||||
color: $accent-fg;
|
||||
}
|
||||
|
||||
@mixin button-disabled() {
|
||||
box-shadow: none;
|
||||
background-color: transparent;
|
||||
color: transparentize($fg-color, 0.7);
|
||||
}
|
||||
|
||||
@mixin button($flat: false, $reactive: true, $radii: $radii, $focusable: true) {
|
||||
all: unset;
|
||||
transition: $transition;
|
||||
border-radius: $radii;
|
||||
color: $fg-color;
|
||||
|
||||
@if $flat {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
box-shadow: none;
|
||||
} @else {
|
||||
background-color: $widget-bg;
|
||||
box-shadow: inset 0 0 0 $border-width $border-color;
|
||||
}
|
||||
|
||||
@if $reactive {
|
||||
@if $focusable {
|
||||
&:focus {
|
||||
@include button-focus;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@include button-hover;
|
||||
}
|
||||
|
||||
&:active,
|
||||
&.on,
|
||||
&.active,
|
||||
&:checked {
|
||||
@include button-active;
|
||||
|
||||
&:hover {
|
||||
box-shadow:
|
||||
inset 0 0 0 $border-width $border-color,
|
||||
inset 0 0 0 99px $hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
@include button-disabled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
@mixin floating-widget {
|
||||
@if $drop-shadow {
|
||||
box-shadow: 0 0 5px 0 $shadow;
|
||||
}
|
||||
|
||||
margin: max($spacing, 8px);
|
||||
border: $border-width solid $popover-border-color;
|
||||
background-color: $bg-color;
|
||||
color: $fg-color;
|
||||
border-radius: $popover-radius;
|
||||
padding: $popover-padding;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
@mixin hidden {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
border-color: transparent;
|
||||
box-shadow: none;
|
||||
-gtk-icon-transform: scale(0);
|
||||
|
||||
* {
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
border-color: transparent;
|
||||
box-shadow: none;
|
||||
-gtk-icon-transform: scale(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
window.popup {
|
||||
> * {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
menu {
|
||||
border-radius: $popover-radius;
|
||||
background-color: $bg-color;
|
||||
padding: $popover-padding;
|
||||
border: $border-width solid $popover-border-color;
|
||||
|
||||
separator {
|
||||
background-color: $border-color;
|
||||
}
|
||||
|
||||
menuitem {
|
||||
@include button;
|
||||
padding: $spacing/2;
|
||||
margin: $spacing/2 0;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
@mixin scrollable {
|
||||
scrollbar,
|
||||
scrollbar * {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
scrollbar.vertical {
|
||||
transition: $transition;
|
||||
background-color: transparentize($bg-color, 0.7);
|
||||
|
||||
&:hover {
|
||||
background-color: transparentize($bg-color, 0.3);
|
||||
|
||||
slider {
|
||||
background-color: transparentize($fg-color, 0.3);
|
||||
min-width: 0.6em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scrollbar.vertical slider {
|
||||
background-color: transparentize($fg-color, 0.5);
|
||||
border-radius: $radii;
|
||||
min-width: 0.4em;
|
||||
min-height: 2em;
|
||||
transition: $transition;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
@import "./unset";
|
||||
|
||||
@mixin slider(
|
||||
$width: 0.7em,
|
||||
$slider-width: 0.5em,
|
||||
$gradient: $active-gradient,
|
||||
$slider: true,
|
||||
$focusable: true,
|
||||
$radii: $radii
|
||||
) {
|
||||
@include unset($rec: true);
|
||||
|
||||
trough {
|
||||
transition: $transition;
|
||||
border-radius: $radii;
|
||||
border: $border;
|
||||
background-color: $widget-bg;
|
||||
min-height: $width;
|
||||
min-width: $width;
|
||||
|
||||
highlight,
|
||||
progress {
|
||||
border-radius: max($radii - $border-width, 0);
|
||||
background-image: $gradient;
|
||||
min-height: $width;
|
||||
min-width: $width;
|
||||
}
|
||||
}
|
||||
|
||||
slider {
|
||||
box-shadow: none;
|
||||
background-color: transparent;
|
||||
border: $border-width solid transparent;
|
||||
transition: $transition;
|
||||
border-radius: $radii;
|
||||
min-height: $width;
|
||||
min-width: $width;
|
||||
margin: -$slider-width;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
trough {
|
||||
background-color: $hover;
|
||||
}
|
||||
|
||||
slider {
|
||||
@if $slider {
|
||||
background-color: $fg-color;
|
||||
border-color: $border-color;
|
||||
|
||||
@if $drop-shadow {
|
||||
box-shadow: 0 0 3px 0 $shadow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
highlight,
|
||||
progress {
|
||||
background-color: transparentize($fg-color, 0.4);
|
||||
background-image: none;
|
||||
}
|
||||
}
|
||||
|
||||
@if $focusable {
|
||||
trough:focus {
|
||||
background-color: $hover;
|
||||
box-shadow: inset 0 0 0 $border-width $accent;
|
||||
|
||||
slider {
|
||||
@if $slider {
|
||||
background-color: $fg-color;
|
||||
box-shadow: inset 0 0 0 $border-width $accent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
@mixin spacing($multiplier: 1, $spacing: $spacing, $rec: false) {
|
||||
&.horizontal > * {
|
||||
margin: 0 $spacing * $multiplier / 2;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.vertical > * {
|
||||
margin: $spacing * $multiplier / 2 0;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@if $rec {
|
||||
box {
|
||||
&.horizontal > * {
|
||||
margin: 0 $spacing * $multiplier / 2;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.vertical > * {
|
||||
margin: $spacing * $multiplier / 2 0;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
@import "./button";
|
||||
|
||||
@mixin switch {
|
||||
@include button;
|
||||
|
||||
slider {
|
||||
background-color: $accent-fg;
|
||||
border-radius: $radii;
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
image {
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
@mixin text-border {
|
||||
text-shadow:
|
||||
-1 * $border-width -1 * $border-width 0 $border-color,
|
||||
$border-width $border-width 0 $border-color,
|
||||
-1 * $border-width $border-width 0 $border-color,
|
||||
$border-width -1 * $border-width 0 $border-color;
|
||||
|
||||
-gtk-icon-shadow:
|
||||
-1 * $border-width -1 * $border-width 0 $border-color,
|
||||
$border-width $border-width 0 $border-color,
|
||||
-1 * $border-width $border-width 0 $border-color,
|
||||
$border-width -1 * $border-width 0 $border-color;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
tooltip {
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
|
||||
> * > * {
|
||||
background-color: $bg-color;
|
||||
border-radius: $radii;
|
||||
border: $border-width solid $popover-border-color;
|
||||
color: $fg-color;
|
||||
padding: 8px;
|
||||
margin: 4px;
|
||||
box-shadow: 0 0 3px 0 $shadow;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
@mixin unset($rec: false) {
|
||||
all: unset;
|
||||
|
||||
@if $rec {
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
@mixin widget {
|
||||
transition: $transition;
|
||||
border-radius: $radii;
|
||||
color: $fg-color;
|
||||
background-color: $widget-bg;
|
||||
border: $border;
|
||||
}
|
||||
Reference in New Issue
Block a user