[libadwaita/wip/exalm/card: 4/14] stylesheet: Add button.opaque style class
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/card: 4/14] stylesheet: Add button.opaque style class
- Date: Thu, 21 Oct 2021 22:56:48 +0000 (UTC)
commit 98cafcb8f39b04975a99d923fd583c46b50ca4d9
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Oct 19 16:38:58 2021 +0500
stylesheet: Add button.opaque style class
Have an explicit way to do colored buttons instead of having apps abuse
.suggested-action and .destructive-action.
Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/251
src/stylesheet/widgets/_buttons.scss | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/stylesheet/widgets/_buttons.scss b/src/stylesheet/widgets/_buttons.scss
index da0e9ab2..1db816c0 100644
--- a/src/stylesheet/widgets/_buttons.scss
+++ b/src/stylesheet/widgets/_buttons.scss
@@ -5,6 +5,8 @@ $button_checked_color: gtkalpha(currentColor, .2);
$button_checked_hover_color: gtkalpha(currentColor, .25);
$button_checked_active_color: gtkalpha(currentColor, .35);
+$opaque_button_default_bg: gtkmix($window_bg_color, $window_fg_color, 85%);
+
%button,
button {
@at-root %button_basic, & {
@@ -145,7 +147,7 @@ button {
}
}
- @at-root %filled_button {
+ @at-root %opaque_button {
box-shadow: none;
@include focus-ring($outer: true, $offset: 1px);
@@ -174,8 +176,15 @@ button {
}
}
+ &.opaque {
+ @extend %opaque_button;
+
+ background-color: $opaque_button_default_bg;
+ color: $window_fg_color;
+ }
+
&.destructive-action {
- @extend %filled_button;
+ @extend %opaque_button;
color: $destructive_fg_color;
@@ -185,7 +194,7 @@ button {
}
&.suggested-action {
- @extend %filled_button;
+ @extend %opaque_button;
color: $accent_fg_color;
@@ -466,7 +475,7 @@ splitbutton {
&.suggested-action {
> button, > menubutton > button {
- @extend %filled_button;
+ @extend %opaque_button;
color: $accent_fg_color;
@@ -478,7 +487,7 @@ splitbutton {
&.destructive-action {
> button, > menubutton > button {
- @extend %filled_button;
+ @extend %opaque_button;
color: $destructive_fg_color;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]