GNOME Bugzilla – Bug 780041
Optionally depend on sassc to generate the theme CSS
Last modified: 2017-04-01 14:41:01 UTC
Instead of using Ruby/Sass, which brings the whole Ruby and Gem ecosystem with it, we can use libsass/sassc to generate the CSS files from Sass files for Adwaita and HighContrast. For more information: * [libsass](http://sass-lang.com/libsass)
Created attachment 347930 [details] [review] Optionally depend on sassc to generate the theme CSS Instead of using Ruby/Sass to generate the CSS from SCSS files, we can use the faster and more lightweight libsass/sassc binary. We can keep the CSS files in Git to make it easier to dist GTK+, but we can add rules to ensure they get rebuilt if the source SCSS changes.
I've noticed a couple of subtle color changes in the generated CSS that may require more investigation. It usually has to do with rounding precision.
Review of attachment 347930 [details] [review]: Looks good, and solves the rebuild issue at the same time.
Slight color changes are not a problem, happens with different (ruby) sass versions as well, it probably is some difference in rounding, the problem with libsass is that it's not in sync (not sure about now) with sass feature wise.
(In reply to Lapo Calamandrei from comment #4) > the problem > with libsass is that it's not in sync (not sure about now) with sass feature > wise. Yep, that was my worry, but: - Adwaita/HighContrast do not use bleeding edge Ruby/sass features - the generated CSS is basically the same, with minor whitespace changes (and rounding) Backstory for this bug: Endless switched to libsass/sassc for its SCSS theming needs from Ruby/sass, mostly because we don't commit the generated CSS to Git and we're building a Flatpak runtime (so installing/building Ruby is out of the question); this is why I thought it would be interesting to have GTK+ move to libsass/sassc as well, especially towards a future where we don't commit the generated CSS files to source control.
Created attachment 349114 [details] [review] Optionally depend on sassc to generate the theme CSS Instead of using Ruby/Sass to generate the CSS from SCSS files, we can use the faster and more lightweight libsass/sassc binary. We can keep the CSS files in Git to make it easier to dist GTK+, but we can add rules to ensure they get rebuilt if the source SCSS changes.
I've pushed this to master; if it breaks too much, I'll be happy to revert it. To test, you will need to have `sassc` installed before running the `configure` script. After that, every time you touch the scss file, the CSS files will be re-generated. Attachment 349114 [details] pushed as 99c79d6 - Optionally depend on sassc to generate the theme CSS