This commit is contained in:
vinceliuice
2024-04-30 15:45:47 +08:00
parent 65fe4fba14
commit c0467e2199
2 changed files with 88 additions and 50 deletions

View File

@@ -283,69 +283,79 @@ spinner {
/**************** /****************
* Text Entries * * Text Entries *
****************/ ****************/
%entry_basic {
min-height: $medium-size;
padding: 0 8px;
border-radius: $corner-radius;
caret-color: currentColor; // this shouldn't be needed.
@include entry(normal);
&:focus { @include entry(checked); }
&:drop(active) { @include entry(hover); }
&:disabled { @include entry(disabled); }
}
%entry, %entry,
entry { entry {
%entry_basic, & { @extend %entry_basic;
min-height: $medium-size;
padding: 0 8px;
border-radius: $corner-radius;
caret-color: currentColor; // this shouldn't be needed.
@include entry(normal); .background:not(.csd) & {
@include entry(solid);
&:focus { @include entry(checked); } &:focus { @include entry(solid-checked); }
&:drop(active) { @include entry(hover); } &:drop(active) { @include entry(solid-hover); }
&:disabled { @include entry(disabled); } &:disabled { @include entry(solid-disabled); }
}
&.flat { &.flat {
min-height: 0; min-height: 0;
padding: 2px; padding: 2px;
border-radius: 0; border-radius: 0;
background-color: transparent; background-color: transparent;
}
image { // icons inside the entry
color: $text-secondary;
&:hover, &:active { color: $text; }
&:disabled { color: $text-disabled; }
&.left {
margin-left: ($medium-size - 16px) / 2 - 8px;
margin-right: 6px;
} }
image { // icons inside the entry &.right {
color: $text-secondary; margin-left: 6px;
margin-right: ($medium-size - 16px) / 2 - 8px;
&:hover, &:active { color: $text; }
&:disabled { color: $text-disabled; }
&.left {
margin-left: ($medium-size - 16px) / 2 - 8px;
margin-right: 6px;
}
&.right {
margin-left: 6px;
margin-right: ($medium-size - 16px) / 2 - 8px;
}
} }
}
undershoot { undershoot {
&.left { @include undershoot(left); } &.left { @include undershoot(left); }
&.right { @include undershoot(right); } &.right { @include undershoot(right); }
}
selection { @extend %selected_items_primary; }
// entry error and warning style
@each $e_type, $e_color in (error, $error),
(warning, $warning) {
&.#{$e_type} {
@include entry(normal, $e_color);
&:focus { @include entry(checked, $e_color); }
&:disabled { @include entry(disabled, $e_color); }
} }
selection { @extend %selected_items_primary; }
// entry error and warning style
@each $e_type, $e_color in (error, $error),
(warning, $warning) {
&.#{$e_type} {
@include entry(normal, $e_color);
&:focus { @include entry(checked, $e_color); }
&:disabled { @include entry(disabled, $e_color); }
}
}
// .osd & {
// }
} }
progress { progress {

View File

@@ -58,6 +58,34 @@
color: $text-disabled; color: $text-disabled;
} }
@if $t == solid {
transition: $transition, box-shadow $ripple-fade-out-duration $ease-out;
box-shadow: inset 0 0 0 2px transparent;
background-color: mix($text, $base, 5%);
color: $text;
}
@if $t == solid-hover {
background-color: mix($text, $base, 10%);
box-shadow: inset 0 0 0 2px $overlay-hover;
}
@if $t == solid-focus {
background-color: mix($text, $base, 8%);
box-shadow: inset 0 0 0 2px if($fc == $primary, $track, $fc);
}
@if $t == solid-checked {
background-color: mix($text, $base, 5%);
box-shadow: inset 0 0 0 2px if($fc == $primary, $primary, $fc);
}
@if $t == solid-disabled {
box-shadow: inset 0 0 0 2px transparent;
background-color: mix($text, $base, 3%);
color: $text-disabled;
}
@if $t == raised-normal { @if $t == raised-normal {
transition: $transition, box-shadow $ripple-fade-out-duration $ease-out; transition: $transition, box-shadow $ripple-fade-out-duration $ease-out;
border-image: none; border-image: none;