[gnome-themes-standard] use mix() when alpha really isn't needed
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] use mix() when alpha really isn't needed
- Date: Mon, 9 Jun 2014 13:14:25 +0000 (UTC)
commit 4e6572383b31ba6e65c9f99e52699b46c36c7f95
Author: Jakub Steiner <jimmac gmail com>
Date: Tue May 27 16:58:26 2014 +0200
use mix() when alpha really isn't needed
- supposedly a lot faste and
- not needed to if() for dark variant in most cases
themes/Adwaita/gtk-3.0/_common.scss | 28 ++++++++++++------------
themes/Adwaita/gtk-3.0/gtk-contained-dark.css | 21 +++++++++---------
themes/Adwaita/gtk-3.0/gtk-contained.css | 21 +++++++++---------
3 files changed, 36 insertions(+), 34 deletions(-)
---
diff --git a/themes/Adwaita/gtk-3.0/_common.scss b/themes/Adwaita/gtk-3.0/_common.scss
index f732956..44fc3b7 100644
--- a/themes/Adwaita/gtk-3.0/_common.scss
+++ b/themes/Adwaita/gtk-3.0/_common.scss
@@ -163,8 +163,7 @@ GtkGrid:insensitive {
$base_color 90%
);
- $_entry_shade: if($variant=='light', transparentize(black, 0.5),
- transparentize(black, 0.4));
+ $_entry_shade: mix(black, $base_color, 50%);
box-shadow: inset 0 2px 2px -2px $_entry_shade,
0 1px $borders_edge;
@@ -180,7 +179,7 @@ GtkGrid:insensitive {
&:focus {
border-color: $selected_bg_color;
box-shadow: inset 0 2px 2px -2px $_entry_shade,
- inset 0 0 2px 1px transparentize($selected_bg_color, 0.8), // focus indicator
+ inset 0 0 2px 1px mix($selected_bg_color, $base_color, 20%), // focus indicator
0 1px $borders_edge;
}
&:selected, &:backdrop:selected {
@@ -191,7 +190,7 @@ GtkGrid:insensitive {
color: $backdrop_fg_color;
border-color: $backdrop_borders_color;
background-image: linear-gradient(to bottom, $backdrop_base_color);
- box-shadow: 0 1px transparentize($borders_edge,1);
+ box-shadow: 0 1px transparentize($borders_edge,1); // not to flicker on transitions
}
&:backdrop:insensitive {
color: $backdrop_insensitive_color;
@@ -425,7 +424,7 @@ GtkComboBox {
icon-shadow: none;
}
&:backdrop:insensitive {
- color: transparentize($backdrop_insensitive_color,0.5);
+ color: mix($backdrop_insensitive_color,$base_color, 50%);
}
.separator {
@@ -459,15 +458,13 @@ GtkComboBox {
border-style: solid;
border-color: $borders_color;
border-radius: 7px 7px 0 0;
-
- $_top_hilight: if($variant=='light', white, transparentize(white,0.9));
background-color: transparent;
background-image: linear-gradient(to bottom,
lighten($bg_color,2%),
darken($bg_color,5%));
- box-shadow: inset 0 -1px transparentize($borders_color,0.6),
- inset 0 1px $_top_hilight;
+ box-shadow: inset 0 -1px mix($borders_color, $bg_color, 30%), // bottom shade
+ inset 0 1px $borders_edge; // top highlight
padding: 6px;
&:backdrop {
@@ -508,6 +505,9 @@ GtkComboBox {
background-image: linear-gradient(to bottom,
lighten($selected_bg_color,5%),
lighten($selected_bg_color,2%));
+ box-shadow: inset 0 -1px mix($borders_color,$bg_color, 30%), //bottom shade
+ inset 0 1px mix($borders_edge,$selected_bg_color, 50%); //top highlight
+
}
.tiled &, .maximized & {
border-radius: 0; // squared corners when the window is max'd or tiled
@@ -533,7 +533,7 @@ column-header {
) 0 1 1 0;
background-image: none;
background-color: $base_color;
- color: transparentize($fg_color,0.5);
+ color: mix($fg_color,$base_color,50%);
font-weight: bold;
}
}
@@ -607,7 +607,7 @@ GtkPopover {
.separator {
font-size: 80%;
font-weight: bold;
- color: transparentize($fg_color,0.4);
+ color: mix($fg_color, $bg_color, 20%);
text-shadow: none;
background-color: transparent;
icon-shadow: none;
@@ -636,7 +636,7 @@ GtkPopover {
&.frame { border-width: 1px; }
&.header {
background-color: darken($bg_color,5%);
- box-shadow: inset 0 6px 4px -5px transparentize(black,0.4);
+ box-shadow: inset 0 6px 4px -5px mix($borders_color, $bg_color, 50%);
// I want just a top shadow
// so negative spread
border-width: 0px;
@@ -727,7 +727,7 @@ GtkPopover {
.frame {
border: 1px solid $borders_color;
padding: 0;
- &:backdrop { border-color: transparentize($borders_color,0.4); }
+ &:backdrop { border-color: mix($borders_color,$bg_color, 40%); }
}
GtkScrolledWindow {
@@ -741,7 +741,7 @@ GtkScrolledWindow {
.separator {
// always disable separators
// -GtkWidget-wide-separators: true;
- color: transparentize($borders_color, 0.8);
+ color: mix($borders_color, $bg_color, 20%);
}
/**********************
diff --git a/themes/Adwaita/gtk-3.0/gtk-contained-dark.css b/themes/Adwaita/gtk-3.0/gtk-contained-dark.css
index 63b50ab..c8e8c49 100644
--- a/themes/Adwaita/gtk-3.0/gtk-contained-dark.css
+++ b/themes/Adwaita/gtk-3.0/gtk-contained-dark.css
@@ -117,7 +117,7 @@ GtkGrid:insensitive {
transition: all 200ms ease-out;
border: 1px solid #1c1f1f;
background-image: linear-gradient(to bottom, #2b2b2b 0%, #333333 90%);
- box-shadow: inset 0 2px 2px -2px rgba(0, 0, 0, 0.6), 0 1px rgba(238, 238, 236, 0.1);
+ box-shadow: inset 0 2px 2px -2px #191919, 0 1px rgba(238, 238, 236, 0.1);
background-color: transparent; }
.entry:insensitive {
color: white;
@@ -125,7 +125,7 @@ GtkGrid:insensitive {
box-shadow: 0 1px rgba(238, 238, 236, 0.1); }
.entry:focus {
border-color: #2a76c6;
- box-shadow: inset 0 2px 2px -2px rgba(0, 0, 0, 0.6), inset 0 0 2px 1px rgba(42, 118, 198, 0.2), 0 1px
rgba(238, 238, 236, 0.1); }
+ box-shadow: inset 0 2px 2px -2px #191919, inset 0 0 2px 1px #314050, 0 1px rgba(238, 238, 236, 0.1); }
.entry:selected, .entry:backdrop:selected {
color: white;
background-color: #2a76c6; }
@@ -520,7 +520,7 @@ GtkComboBox {
text-shadow: none;
icon-shadow: none; }
GtkComboBox:backdrop:insensitive {
- color: rgba(255, 255, 255, 0.5); }
+ color: #999999; }
GtkComboBox .separator {
-GtkWidget-wide-separators: true;
-GtkWidget-horizontal-separator: 0;
@@ -546,7 +546,7 @@ GtkComboBox {
border-radius: 7px 7px 0 0;
background-color: transparent;
background-image: linear-gradient(to bottom, #3e4444, #2d3232);
- box-shadow: inset 0 -1px rgba(28, 31, 31, 0.4), inset 0 1px rgba(255, 255, 255, 0.1);
+ box-shadow: inset 0 -1px #303535, inset 0 1px rgba(238, 238, 236, 0.1);
padding: 6px; }
.header-bar:backdrop {
border-color: #1c1f1f;
@@ -569,7 +569,8 @@ GtkComboBox {
.header-bar.selection-mode {
color: #1c5187;
text-shadow: 0 1px rgba(0, 0, 0, 0.5);
- background-image: linear-gradient(to bottom, #3583d5, #2b7bcf); }
+ background-image: linear-gradient(to bottom, #3583d5, #2b7bcf);
+ box-shadow: inset 0 -1px #303535, inset 0 1px rgba(51, 123, 199, 0.55); }
.tiled .header-bar, .maximized .header-bar {
border-radius: 0; }
@@ -587,7 +588,7 @@ column-header .button:backdrop {
border-image: linear-gradient(to top, #272929, #333333) 0 1 1 0;
background-image: none;
background-color: #333333;
- color: rgba(238, 238, 236, 0.5);
+ color: #90908f;
font-weight: bold; }
/*********
@@ -642,7 +643,7 @@ GtkPopover {
GtkPopover .separator {
font-size: 80%;
font-weight: bold;
- color: rgba(238, 238, 236, 0.6);
+ color: #5d6261;
text-shadow: none;
background-color: transparent;
icon-shadow: none;
@@ -669,7 +670,7 @@ GtkPopover {
border-width: 1px; }
.notebook.header {
background-color: #2d3232;
- box-shadow: inset 0 6px 4px -5px rgba(0, 0, 0, 0.6);
+ box-shadow: inset 0 6px 4px -5px #2a2f2f;
border-width: 0px; }
.notebook.header.frame {
border: 1px solid #1c1f1f; }
@@ -754,7 +755,7 @@ GtkPopover {
border: 1px solid #1c1f1f;
padding: 0; }
.frame:backdrop {
- border-color: rgba(28, 31, 31, 0.6); }
+ border-color: #2d3232; }
GtkScrolledWindow .frame {
border-radius: 2px; }
@@ -762,7 +763,7 @@ GtkScrolledWindow GtkViewport.frame {
border-style: none; }
.separator {
- color: rgba(28, 31, 31, 0.2); }
+ color: #333838; }
/**********************
* Window Decorations *
diff --git a/themes/Adwaita/gtk-3.0/gtk-contained.css b/themes/Adwaita/gtk-3.0/gtk-contained.css
index 458db18..d60e437 100644
--- a/themes/Adwaita/gtk-3.0/gtk-contained.css
+++ b/themes/Adwaita/gtk-3.0/gtk-contained.css
@@ -117,7 +117,7 @@ GtkGrid:insensitive {
transition: all 200ms ease-out;
border: 1px solid #a1a1a1;
background-image: linear-gradient(to bottom, #f7f7f7 0%, white 90%);
- box-shadow: inset 0 2px 2px -2px rgba(0, 0, 0, 0.5), 0 1px white;
+ box-shadow: inset 0 2px 2px -2px #7f7f7f, 0 1px white;
background-color: transparent; }
.entry:insensitive {
color: #748489;
@@ -125,7 +125,7 @@ GtkGrid:insensitive {
box-shadow: 0 1px white; }
.entry:focus {
border-color: #4a90d9;
- box-shadow: inset 0 2px 2px -2px rgba(0, 0, 0, 0.5), inset 0 0 2px 1px rgba(74, 144, 217, 0.2), 0 1px
white; }
+ box-shadow: inset 0 2px 2px -2px #7f7f7f, inset 0 0 2px 1px #dae8f7, 0 1px white; }
.entry:selected, .entry:backdrop:selected {
color: white;
background-color: #4a90d9; }
@@ -520,7 +520,7 @@ GtkComboBox {
text-shadow: none;
icon-shadow: none; }
GtkComboBox:backdrop:insensitive {
- color: rgba(199, 199, 199, 0.5); }
+ color: #e3e3e3; }
GtkComboBox .separator {
-GtkWidget-wide-separators: true;
-GtkWidget-horizontal-separator: 0;
@@ -546,7 +546,7 @@ GtkComboBox {
border-radius: 7px 7px 0 0;
background-color: transparent;
background-image: linear-gradient(to bottom, #f2f2f2, #e0e0e0);
- box-shadow: inset 0 -1px rgba(161, 161, 161, 0.4), inset 0 1px white;
+ box-shadow: inset 0 -1px #d6d6d6, inset 0 1px white;
padding: 6px; }
.header-bar:backdrop {
border-color: #a1a1a1;
@@ -569,7 +569,8 @@ GtkComboBox {
.header-bar.selection-mode {
color: #256ab1;
text-shadow: 0 1px rgba(0, 0, 0, 0.5);
- background-image: linear-gradient(to bottom, #5f9ddd, #5295db); }
+ background-image: linear-gradient(to bottom, #5f9ddd, #5295db);
+ box-shadow: inset 0 -1px #d6d6d6, inset 0 1px #a4c7ec; }
.tiled .header-bar, .maximized .header-bar {
border-radius: 0; }
@@ -587,7 +588,7 @@ column-header .button:backdrop {
border-image: linear-gradient(to top, #d0d0d0, white) 0 1 1 0;
background-image: none;
background-color: white;
- color: rgba(46, 52, 54, 0.5);
+ color: #96999a;
font-weight: bold; }
/*********
@@ -642,7 +643,7 @@ GtkPopover {
GtkPopover .separator {
font-size: 80%;
font-weight: bold;
- color: rgba(46, 52, 54, 0.6);
+ color: #c6c8c8;
text-shadow: none;
background-color: transparent;
icon-shadow: none;
@@ -669,7 +670,7 @@ GtkPopover {
border-width: 1px; }
.notebook.header {
background-color: #e0e0e0;
- box-shadow: inset 0 6px 4px -5px rgba(0, 0, 0, 0.6);
+ box-shadow: inset 0 6px 4px -5px #c7c7c7;
border-width: 0px; }
.notebook.header.frame {
border: 1px solid #a1a1a1; }
@@ -754,7 +755,7 @@ GtkPopover {
border: 1px solid #a1a1a1;
padding: 0; }
.frame:backdrop {
- border-color: rgba(161, 161, 161, 0.6); }
+ border-color: #cecece; }
GtkScrolledWindow .frame {
border-radius: 2px; }
@@ -762,7 +763,7 @@ GtkScrolledWindow GtkViewport.frame {
border-style: none; }
.separator {
- color: rgba(161, 161, 161, 0.2); }
+ color: #dddddd; }
/**********************
* Window Decorations *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]