[epiphany/wip/exalm/hc: 14/15] css: Support HighContrast(Inverse)



commit 46f8b589969c4311eab61cf4cf84e2a6cd1aed84
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Apr 21 20:22:18 2020 +0500

    css: Support HighContrast(Inverse)
    
    Since HC is now a variant of Adwaita with darker borders and fg, it's now
    easy to support it, so just do that.
    
    Other than applying the same tweaks, disable url entry transparency.

 src/resources/epiphany.gresource.xml              |  2 ++
 src/resources/parse-sass.sh                       |  6 ++++++
 src/resources/themes/Adwaita-dark.scss            |  1 +
 src/resources/themes/Adwaita.scss                 |  1 +
 src/resources/themes/HighContrast.scss            |  6 ++++++
 src/resources/themes/HighContrastInverse.scss     |  6 ++++++
 src/resources/themes/_Adwaita-base.scss           |  6 ++++--
 src/resources/themes/_Adwaita-colored-window.scss | 12 ++++++++++++
 8 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/src/resources/epiphany.gresource.xml b/src/resources/epiphany.gresource.xml
index b8d5dc52d..12da60dd5 100644
--- a/src/resources/epiphany.gresource.xml
+++ b/src/resources/epiphany.gresource.xml
@@ -55,5 +55,7 @@
     <file compressed="true">themes/Adwaita.css</file>
     <file compressed="true">themes/Adwaita-dark.css</file>
     <file compressed="true">themes/elementary.css</file>
+    <file compressed="true">themes/HighContrast.css</file>
+    <file compressed="true">themes/HighContrastInverse.css</file>
   </gresource>
 </gresources>
diff --git a/src/resources/parse-sass.sh b/src/resources/parse-sass.sh
index 00aab8a4f..a1280d290 100755
--- a/src/resources/parse-sass.sh
+++ b/src/resources/parse-sass.sh
@@ -17,3 +17,9 @@ sassc $SASSC_OPT -I${GTK_SOURCE_PATH}/gtk/theme/Adwaita \
        themes/elementary.scss themes/elementary.css
 sassc $SASSC_OPT -I${GTK_SOURCE_PATH}/gtk/theme/Adwaita \
        themes/shared.scss themes/shared.css
+sassc $SASSC_OPT -I${GTK_SOURCE_PATH}/gtk/theme/Adwaita \
+       -I${GTK_SOURCE_PATH}/gtk/theme/HighContrast \
+       themes/HighContrast.scss themes/HighContrast.css
+sassc $SASSC_OPT -I${GTK_SOURCE_PATH}/gtk/theme/Adwaita \
+       -I${GTK_SOURCE_PATH}/gtk/theme/HighContrast \
+       themes/HighContrastInverse.scss themes/HighContrastInverse.css
diff --git a/src/resources/themes/Adwaita-dark.scss b/src/resources/themes/Adwaita-dark.scss
index 10df3fec9..9d7f7364d 100644
--- a/src/resources/themes/Adwaita-dark.scss
+++ b/src/resources/themes/Adwaita-dark.scss
@@ -1,3 +1,4 @@
 $variant: 'dark';
+$high_contrast: false;
 
 @import 'Adwaita-base';
diff --git a/src/resources/themes/Adwaita.scss b/src/resources/themes/Adwaita.scss
index 84d2772fc..1b4100235 100644
--- a/src/resources/themes/Adwaita.scss
+++ b/src/resources/themes/Adwaita.scss
@@ -1,3 +1,4 @@
 $variant: 'light';
+$high_contrast: false;
 
 @import 'Adwaita-base';
diff --git a/src/resources/themes/HighContrast.scss b/src/resources/themes/HighContrast.scss
new file mode 100644
index 000000000..445642840
--- /dev/null
+++ b/src/resources/themes/HighContrast.scss
@@ -0,0 +1,6 @@
+$variant: 'light';
+$high_contrast: true;
+
+@import 'colors';
+@import 'colors-hc';
+@import 'Adwaita-base';
diff --git a/src/resources/themes/HighContrastInverse.scss b/src/resources/themes/HighContrastInverse.scss
new file mode 100644
index 000000000..a49c0e1e6
--- /dev/null
+++ b/src/resources/themes/HighContrastInverse.scss
@@ -0,0 +1,6 @@
+$variant: 'dark';
+$high_contrast: true;
+
+@import 'colors';
+@import 'colors-hc';
+@import 'Adwaita-base';
diff --git a/src/resources/themes/_Adwaita-base.scss b/src/resources/themes/_Adwaita-base.scss
index d65a439a3..4e5162a05 100644
--- a/src/resources/themes/_Adwaita-base.scss
+++ b/src/resources/themes/_Adwaita-base.scss
@@ -40,8 +40,10 @@ $close_button_fg_color: if($variant == 'light', lighten($fg_color, 10%), darken(
   }
 }
 
-.url_entry:not(:hover):not(:focus) {
-  background-color: transparentize($base_color, 0.25);
+@if not $high_contrast {
+  .url_entry:not(:hover):not(:focus) {
+    background-color: transparentize($base_color, 0.25);
+  }
 }
 
 .bookmark-tag-widget {
diff --git a/src/resources/themes/_Adwaita-colored-window.scss 
b/src/resources/themes/_Adwaita-colored-window.scss
index 62729109d..d813839b7 100644
--- a/src/resources/themes/_Adwaita-colored-window.scss
+++ b/src/resources/themes/_Adwaita-colored-window.scss
@@ -20,6 +20,18 @@ $backdrop_borders_color: mix($borders_color, $bg_color, 80%);
 $backdrop_dark_fill: mix($backdrop_borders_color, $backdrop_bg_color, 35%);
 $backdrop_insensitive_color: if($variant == 'light', darken($backdrop_bg_color, 15%), 
lighten($backdrop_bg_color, 15%));
 
+@if $high_contrast {
+  $fg_color: if($variant == 'light', darken($fg_color, 3%), lighten($fg_color, 2%));
+  $bg_color: if($variant == 'light', lighten($bg_color, 3%), darken($bg_color, 2%));
+  $borders_color: if($variant == 'light', darken($borders_color, 30%), lighten($borders_color, 30%));
+  $alt_borders_color: if($variant == 'light', darken($alt_borders_color, 33%), lighten($alt_borders_color, 
28%));
+
+  //insensitive state derived colors
+  $insensitive_fg_color: mix($fg_color, $bg_color, 50%);
+  $insensitive_bg_color: mix($bg_color, $base_color, 60%);
+  $insensitive_borders_color: mix($borders_color, $bg_color, 80%);
+}
+
 @import 'drawing';
 
 headerbar {


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