[gnome-themes-standard/wip/sass] add destructive action.



commit 1adc21146a676b2fca984862fba823ca32224acc
Author: Jakub Steiner <jimmac gmail com>
Date:   Wed May 14 15:14:33 2014 +0200

    add destructive action.
    
    - done legibly using @each with multi-lists (needs SASS 3.3)

 themes/Adwaita/gtk-3.0/_common.scss  |   33 +++++++++++++++++++++++++--------
 themes/Adwaita/gtk-3.0/_drawing.scss |   15 +++++++++++++++
 2 files changed, 40 insertions(+), 8 deletions(-)
---
diff --git a/themes/Adwaita/gtk-3.0/_common.scss b/themes/Adwaita/gtk-3.0/_common.scss
index 623a432..3faae02 100644
--- a/themes/Adwaita/gtk-3.0/_common.scss
+++ b/themes/Adwaita/gtk-3.0/_common.scss
@@ -189,7 +189,6 @@ GtkGrid:insensitive {
 /***********
  * Buttons *
  ***********/
-
 .button,
 .toolbar .button.raised,
 .toolbar .raised .button,
@@ -206,15 +205,33 @@ GtkGrid:insensitive {
   &:active {
     @include button_active($theme_bg_color);
   }
-  &:insensitive, &:backdrop:insensitive {
-    background-image: linear-gradient(to bottom, transparent);
+  &:backdrop {
+    @include button_backdrop($theme_bg_color);
     color: $insensitive_fg_color;
   }
-  &.suggested-action {
-    @include button_normal($theme_selected_bg_color);
-    color: $theme_base_color; /* FIXME */
-    &:active {
-      @include button_active($theme_selected_bg_color);
+  &:insensitive {
+    @include button_insensitive($theme_bg_color);
+  }
+  &:backdrop:insensitive {
+    @include button_insensitive(transparentize($theme_bg_color,0.5));
+  }
+  @each $b_type, $b_color in (suggested-action, $theme_selected_bg_color), (destructive-action, red) {
+    &.#{$b_type} {
+      @include button_normal($b_color);
+      color: $theme_base_color; 
+      &:active {
+        @include button_active($b_color);
+      }
+      &:hover {
+        @include button_hover($b_color);
+      }
+      &:backdrop {
+        @include button_backdrop($b_color);
+      }
+      &:insensitive {
+        color: $theme_base_color; 
+        @include button_insensitive($b_color);
+      }
     }
   }
 }
diff --git a/themes/Adwaita/gtk-3.0/_drawing.scss b/themes/Adwaita/gtk-3.0/_drawing.scss
index ff0fb71..8dcfdda 100644
--- a/themes/Adwaita/gtk-3.0/_drawing.scss
+++ b/themes/Adwaita/gtk-3.0/_drawing.scss
@@ -11,6 +11,10 @@
                                       $c 40%,
                                       darken($c,10%)
                                       );
+  // this doesn't work for the edge highlight
+  // right now due to gtk not allocating external space
+  box-shadow: inset 0 1px $borders_edge, //top edge
+              0 1px $borders_edge; //not working
 }
 
 @mixin button_hover ($c) {
@@ -31,6 +35,17 @@
   box-shadow: inset 0 1px 2px darken($c,30%);
 }
 
+ mixin button_backdrop ($c) {
+  border: 1px solid darken($c,30%);
+  background-image: linear-gradient(to bottom, //single color gradient for transitions. Lapo hates me for 
this :)
+                                      $c);
+}
+
+ mixin button_insensitive ($c) {
+  border: 1px solid darken($c,30%);
+  background-image: linear-gradient(to bottom,transparentize($c,0.5));
+}
+
 @mixin border-rounded() {
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]