After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780041 - Optionally depend on sassc to generate the theme CSS
Optionally depend on sassc to generate the theme CSS
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-03-14 16:49 UTC by Emmanuele Bassi (:ebassi)
Modified: 2017-04-01 14:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Optionally depend on sassc to generate the theme CSS (4.07 KB, patch)
2017-03-14 16:49 UTC, Emmanuele Bassi (:ebassi)
none Details | Review
Optionally depend on sassc to generate the theme CSS (4.08 KB, patch)
2017-04-01 14:38 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2017-03-14 16:49:17 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)
Comment 1 Emmanuele Bassi (:ebassi) 2017-03-14 16:49:27 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2017-03-14 16:51:03 UTC
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.
Comment 3 Matthias Clasen 2017-03-15 10:50:46 UTC
Review of attachment 347930 [details] [review]:

Looks good, and solves the rebuild issue at the same time.
Comment 4 Lapo Calamandrei 2017-03-15 22:24:59 UTC
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.
Comment 5 Emmanuele Bassi (:ebassi) 2017-03-16 10:37:52 UTC
(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.
Comment 6 Emmanuele Bassi (:ebassi) 2017-04-01 14:38:16 UTC
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.
Comment 7 Emmanuele Bassi (:ebassi) 2017-04-01 14:40:57 UTC
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