[gnome-shell-sass] theme: Remove unnecessary !important rules



commit db148b49795883832971f180befe11c02f4dfd0d
Author: nana-4 <hnmaigo gmail com>
Date:   Sat Jan 25 11:37:16 2020 +0900

    theme: Remove unnecessary !important rules
    
    Using !important is a bad practice and should be avoided wherever
    possible to make styling and debugging easier. See:
    
    https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity#The_!important_exception
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/957

 _drawing.scss                    | 8 ++++----
 widgets/_app-grid.scss           | 9 ++++-----
 widgets/_calendar.scss           | 8 ++++----
 widgets/_dash.scss               | 7 +++----
 widgets/_keyboard.scss           | 4 ++--
 widgets/_popovers.scss           | 3 +--
 widgets/_search-results.scss     | 4 +---
 widgets/_workspace-switcher.scss | 8 ++++----
 8 files changed, 23 insertions(+), 28 deletions(-)
---
diff --git a/_drawing.scss b/_drawing.scss
index 3afacea..44323b3 100644
--- a/_drawing.scss
+++ b/_drawing.scss
@@ -137,7 +137,7 @@
   // normal button
   @if $t==normal {
     color: $tc;
-    background-color: lighten($c, 3%) !important;
+    background-color: lighten($c, 3%);
     border-color: draw_border_color($c);
     @include draw_shadows($button_shadow);
     // box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
@@ -157,7 +157,7 @@
   // hover button
   @else if $t==hover {
     color: $tc;
-    background-color: lighten($c, if($variant == 'light', 8%, 5%)) !important;
+    background-color: lighten($c, if($variant == 'light', 8%, 5%));
     border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
     @include draw_shadows($button_shadow);
     text-shadow: 0 1px $text_shadow_color;
@@ -167,7 +167,7 @@
   // active button
   @else if $t==active {
     color: $tc;
-    background-color: darken($c,3%) !important;
+    background-color: darken($c,3%);
     border-color: draw_border_color(if($variant == 'light', $c, darken($c,7%)));
     text-shadow: none;
     icon-shadow: none;
@@ -178,7 +178,7 @@
   @else if $t==insensitive {
     color: $insensitive_fg_color;
     border-color: $insensitive_borders_color;
-    background-color: $insensitive_bg_color !important;
+    background-color: $insensitive_bg_color;
     box-shadow: none;
     text-shadow: none;
     icon-shadow: none;
diff --git a/widgets/_app-grid.scss b/widgets/_app-grid.scss
index e8736dd..e3e289d 100644
--- a/widgets/_app-grid.scss
+++ b/widgets/_app-grid.scss
@@ -37,7 +37,7 @@ $app_grid_fg_color: #fff;
 
   .overview-icon {
     @extend %icon_tile;
-    color: $app_grid_fg_color !important;
+    color: $app_grid_fg_color;
   }
 
   &:selected {
@@ -58,7 +58,7 @@ $app_grid_fg_color: #fff;
 
   &:focus {
     .overview-icon {
-      background-color: transparentize($osd_fg_color,0.7  );
+      background-color: transparentize($osd_fg_color,0.7);
       // border-color: $selected_bg_color;
       color: $app_grid_fg_color;
     }
@@ -203,13 +203,12 @@ $app_grid_fg_color: #fff;
 
 // buttons
 .app-view-control {
-
   padding: 4px 32px;
   margin: 0 4px;
+
   &, &:hover, &:checked {
     @include button(undecorated);
     color: darken($osd_fg_color, 25%);
-    background-color: transparent !important;
   }
 
   &:hover {
@@ -232,6 +231,6 @@ $app_grid_fg_color: #fff;
   }
 
   &:last-child {
-   border-radius: 0;
+    border-radius: 0;
   }
 }
diff --git a/widgets/_calendar.scss b/widgets/_calendar.scss
index 8ba3d63..0331dd3 100644
--- a/widgets/_calendar.scss
+++ b/widgets/_calendar.scss
@@ -49,9 +49,9 @@
   // calendar
   .calendar {
     @extend %notification_bubble;
-    margin:$base_margin !important;
-    margin-bottom: $base_padding + $base_margin !important;
-    padding:$base_padding !important;
+    margin: $base_margin;
+    margin-bottom: $base_padding + $base_margin;
+    padding: $base_padding;
 
     // more below for sub-elements
   }
@@ -68,7 +68,7 @@
     .world-clocks-button,
     .weather-button {
       @extend %notification_bubble;
-      padding:$base_padding !important;
+      padding: $base_padding;
     }
   }
 }
diff --git a/widgets/_dash.scss b/widgets/_dash.scss
index 9956a1a..8de114b 100644
--- a/widgets/_dash.scss
+++ b/widgets/_dash.scss
@@ -9,12 +9,11 @@ $dash_border_radius: $modal_radius * 1.5;
   @include fontsize($base_font_size - 2);
   padding: ($dash_spacing / 2) 0;
 
-  //fixme: can't have non uniform borders :(
   border-radius: 0 $dash_border_radius $dash_border_radius 0; 
-  border-left-width: 0 !important;
-  &:rtl { 
+  border-left-width: 0;
+  &:rtl {
     border-radius: $dash_border_radius 0 0 $dash_border_radius;
-    border-right-width: 0 !important;
+    border-right-width: 0;
   }
 
   .placeholder {
diff --git a/widgets/_keyboard.scss b/widgets/_keyboard.scss
index 2f3678b..1842ebe 100644
--- a/widgets/_keyboard.scss
+++ b/widgets/_keyboard.scss
@@ -10,7 +10,7 @@ $default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten
 // draw keys using button function
 #keyboard {
   background-color: transparentize(if($variant=='light', darken($bg_color, 5%), darken($bg_color, 8%)), 0.1);
-  box-shadow: inset 0 1px 0 0 $osd_outer_borders_color !important;
+  box-shadow: inset 0 1px 0 0 $osd_outer_borders_color;
 
   .page-indicator {
     padding: $base_padding;
@@ -121,4 +121,4 @@ $default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten
   @include fontsize($base_font_size + 3);
   spacing: 12px;
   min-height: 20pt;
-}
\ No newline at end of file
+}
diff --git a/widgets/_popovers.scss b/widgets/_popovers.scss
index f0c87e1..e456498 100644
--- a/widgets/_popovers.scss
+++ b/widgets/_popovers.scss
@@ -87,7 +87,6 @@ $popover_arrow_height: 12px;
   height: 1px; //not really the whole box
   margin: 6px 64px;
   background-color: lighten($borders_color, 2%);
-  border: none !important;
 }
 
 // desktop background menu
@@ -118,4 +117,4 @@ $popover_arrow_height: 12px;
       margin-right: $base_icon_size;
     }
   }
-}
\ No newline at end of file
+}
diff --git a/widgets/_search-results.scss b/widgets/_search-results.scss
index 15a9ee0..600aa83 100644
--- a/widgets/_search-results.scss
+++ b/widgets/_search-results.scss
@@ -8,8 +8,6 @@
 // search results sections "the boxes"
 .search-section {
   spacing: $base_margin * 2;
-  padding:0 !important;
-  margin:0 !important;
   background-color:transparent;
   box-shadow:none;
   border:none;
@@ -118,7 +116,7 @@
   padding: $base_padding;
   color: $osd_fg_color;
 
-  border-radius: $base_border_radius + 2px !important;
+  border-radius: $base_border_radius + 2px;
 
   &:focus,
   &:selected,
diff --git a/widgets/_workspace-switcher.scss b/widgets/_workspace-switcher.scss
index f3a2270..a6ea83a 100644
--- a/widgets/_workspace-switcher.scss
+++ b/widgets/_workspace-switcher.scss
@@ -45,11 +45,11 @@
   padding: $base_padding;
 
   border-radius: $modal_radius 0 0 $modal_radius;
-  border-right-width: 0 !important;
+  border-right-width: 0;
 
-  &:rtl { 
+  &:rtl {
     border-radius: 0 $modal_radius $modal_radius 0; 
-    border-left-width: 0 !important;
+    border-left-width: 0;
   }
 
   // drag and drop indicator
@@ -66,4 +66,4 @@
   border-radius: 3px;
   padding: 0px;
   // background-color: transparentize($selected_bg_color, 0.9);
-}
\ No newline at end of file
+}


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