[gtk+] Rebuild CSS on all SCSS file changes



commit f6cbd076dd5a7a76133d9b5166643b71dc68f98e
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Apr 1 16:10:18 2017 +0100

    Rebuild CSS on all SCSS file changes
    
    Adwaita and HighContrast CSS should be rebuild every time one of their
    dependent files change, not just the main entry point.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780041

 gtk/Makefile.am                      |   18 ++++++------
 gtk/theme/Adwaita/Gemfile            |    2 -
 gtk/theme/Adwaita/README             |   47 +++++++++++++++++----------------
 gtk/theme/Adwaita/parse-sass.sh      |    3 --
 gtk/theme/Adwaita/render-assets.sh   |   34 ------------------------
 gtk/theme/HighContrast/Gemfile       |    2 -
 gtk/theme/HighContrast/parse-sass.sh |    3 --
 7 files changed, 33 insertions(+), 76 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 9adab54..2b357e3 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1284,20 +1284,16 @@ gesture_sources =                               \
        gesture/gesture-two-finger-swipe-right-symbolic.svg
 
 adwaita_theme_scss = \
-       theme/Adwaita/_colors-public.scss       \
        theme/Adwaita/_colors.scss              \
+       theme/Adwaita/_colors-public.scss       \
        theme/Adwaita/_common.scss              \
        theme/Adwaita/_drawing.scss             \
-       theme/Adwaita/gtk-contained-dark.scss   \
-       theme/Adwaita/gtk-contained.scss        \
        $()
 
 highcontrast_theme_scss = \
        theme/HighContrast/_colors.scss         \
        theme/HighContrast/_common.scss         \
        theme/HighContrast/_drawing.scss        \
-       theme/HighContrast/gtk-contained-inverse.scss \
-       theme/HighContrast/gtk-contained.scss   \
        $()
 
 if REBUILD_SCSS
@@ -1308,16 +1304,16 @@ scss_verbose = $(scss_verbose_@AM_V@)
 scss_verbose_ = $(scss_verbose_@AM_DEFAULT_V@)
 scss_verbose_0 = @echo "  SCSS     $@";
 
-theme/Adwaita/gtk-contained.css: $(top_srcdir)/gtk/theme/Adwaita/gtk-contained.scss
+theme/Adwaita/gtk-contained.css: $(top_srcdir)/gtk/theme/Adwaita/gtk-contained.scss $(adwaita_theme_scss)
        $(scss_verbose) $(MKDIR_P) $(dir $@) && $(SASSC) -a $< $@ || rm -f $@
 
-theme/Adwaita/gtk-contained-dark.css: $(top_srcdir)/gtk/theme/Adwaita/gtk-contained-dark.scss
+theme/Adwaita/gtk-contained-dark.css: $(top_srcdir)/gtk/theme/Adwaita/gtk-contained-dark.scss 
$(adwaita_theme_scss)
        $(scss_verbose) $(MKDIR_P) $(dir $@) && $(SASSC) -a $< $@ || rm -f $@
 
-theme/HighContrast/gtk-contained.css: $(top_srcdir)/gtk/theme/HighContrast/gtk-contained.scss
+theme/HighContrast/gtk-contained.css: $(top_srcdir)/gtk/theme/HighContrast/gtk-contained.scss 
$(highcontrast_theme_scss)
        $(scss_verbose) $(MKDIR_P) $(dir $@) && $(SASSC) -a $< $@ || rm -f $@
 
-theme/HighContrast/gtk-contained-inverse.css: $(top_srcdir)/gtk/theme/HighContrast/gtk-contained-inverse.scss
+theme/HighContrast/gtk-contained-inverse.css: 
$(top_srcdir)/gtk/theme/HighContrast/gtk-contained-inverse.scss $(highcontrast_theme_scss)
        $(scss_verbose) $(MKDIR_P) $(dir $@) && $(SASSC) -a $< $@ || rm -f $@
 
 endif # REBUILD_SCSS
@@ -1326,6 +1322,8 @@ theme_sources =                           \
        theme/win32/gtk.css                     \
        theme/win32/gtk-win32-base.css          \
        $(adwaita_theme_scss)                   \
+       theme/Adwaita/gtk-contained.scss        \
+       theme/Adwaita/gtk-contained-dark.scss   \
        theme/Adwaita/assets.txt                \
        theme/Adwaita/assets.svg                \
        theme/Adwaita/README                    \
@@ -1334,6 +1332,8 @@ theme_sources =                           \
        theme/Adwaita/gtk.css                   \
        theme/Adwaita/gtk-dark.css              \
        $(highcontrast_theme_scss)              \
+       theme/HighContrast/gtk-contained.scss   \
+       theme/HighContrast/gtk-contained-inverse.scss \
        theme/HighContrast/gtk-contained.css    \
        theme/HighContrast/gtk-contained-inverse.css \
        theme/HighContrast/gtk.css              \
diff --git a/gtk/theme/Adwaita/README b/gtk/theme/Adwaita/README
index b5a397e..fd5692e 100644
--- a/gtk/theme/Adwaita/README
+++ b/gtk/theme/Adwaita/README
@@ -1,36 +1,37 @@
 Summary
 -------
 
-* Do not edit the CSS directly, edit the source SCSS files and process them with SASS (run 
-  `./parse-sass.sh` when you have the required software installed, as described below)
-* To be able to use the latest/adequate version of sass, install ruby, gem, sass & bundle.
-  On Fedora F20, this is done with `sudo dnf install rubygems && gem install bundle && bundle install`
-  from the same directory this README resides in.
+* Do not edit the CSS directly, edit the source SCSS files
+* To be able to use the latest/adequate version of sass, install sassc
+* The configure script will detect whether or not you have sassc installed;
+  if you do, it will regenerate the CSS every time you modify the SCSS files.
 
 How to tweak the theme
 ----------------------
 
-Adwaita is a complex theme, so to keep it maintainable it's written and processed in SASS. The
-generated CSS is then transformed into a gresource file during gtk build and used at runtime in a 
-non-legible or editable form.
+Adwaita is a complex theme, so to keep it maintainable it's written and
+processed in SASS. The generated CSS is then transformed into a gresource file
+during gtk build and used at runtime in a non-legible or editable form.
 
-It is very likely your change will happen in the _common.scss file. That's where all the widget 
-selectors are defined. Here's a rundown of the "supporting" stylesheets, that are unlikely to be the 
-right place for a drive by stylesheet fix:
+It is very likely your change will happen in the _common.scss file. That's where
+all the widget selectors are defined. Here's a rundown of the "supporting"
+stylesheets, that are unlikely to be the right place for a drive by stylesheet
+fix:
 
-_colors.scss        - global color definitions. We keep the number of defined colors to a necessary minimum, 
-                      most colors are derived form a handful of basics. It covers both the light variant and
-                      the dark variant.
+_colors.scss        - global color definitions. We keep the number of defined
+                      colors to a necessary minimum, most colors are derived
+                      from a handful of basics. It covers both the light variant
+                      and the dark variant.
 
-_colors-public.scss - SCSS colors exported through gtk to allow for 3rd party apps color mixing.
+_colors-public.scss - SCSS colors exported through gtk to allow for 3rd party
+                      apps color mixing.
 
-_drawing.scss       - drawing helper mixings/functions to allow easier definition of widget drawing under
-                      specific context. This is why Adwaita isn't 15000 LOC.
+_drawing.scss       - drawing helper mixings/functions to allow easier
+                      definition of widget drawing under specific context. This
+                      is why Adwaita isn't 15000 LOC.
 
-_common.scss        - actual definitions of style for each widget. This is where you are likely to add/remove
-                      your changes.
+_common.scss        - actual definitions of style for each widget. This is
+                      where you are likely to add/remove your changes.
                       
-You can read about SASS at http://sass-lang.com/documentation/. Once you make your changes to the
-_common.scss file, you can either run the ./parse-sass.sh script or keep SASS watching for changes as you
-edit. This is done by running `bundle exec sass --watch --sourcemap=none .` If sass is out of date, or is
-missing, you can install it with `bundle install`.
+You can read about SASS at http://sass-lang.com/documentation/. Once you make
+your changes to the _common.scss file, GTK+ will rebuild the CSS files.


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