Commit c62e7a6a authored by Mario Sanchez Prada's avatar Mario Sanchez Prada

build: Make sassc mandatory and always generate CSS files from Sass sources

The previous implementation of the CSS generation logic considered sassc
an optional dependency and made sure for that reason that the result CSS
files ended up in the source directory, so that they could be checked
in and kept in sync with the source sass files.

As we are making sassc a required dependency, we can now stop doing that
extra work and simply rely on the CSS files being automatically generated
each time the sass sources change. By doing this, we can now effectively
get rid of the CSS files checked in the repo as well as of the parse_sass.sh
script, since the CSS files will now live on the build directory only.

https://bugzilla.gnome.org/show_bug.cgi?id=792822
parent 92f1aec3
Summary
-------
* Do not edit the CSS directly, edit the source SCSS files and process them with SASS (running
`make` should do that when you have the required software installed, as described below;
run `./parse-sass.sh` manually if it doesn't)
* Most SASS preprocessors should produce similar results, however the build system
integration and 'parse-sass.sh' script use sassc. You should be able to install
it with `pkcon install sassc` or your distribution's package manager.
* Do not edit the CSS directly, edit the source SCSS files and the CSS files will be generated
automatically when building with meson + ninja and left inside the build directory to be
incorporated into the gresource XML (you'll need to have sassc installed).
How to tweak the theme
----------------------
......@@ -31,4 +28,4 @@ _common.scss - actual definitions of style for each widget. This is where
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 make or the ./parse-sass.sh script.
_common.scss file, you can run ninja to generate the final CSS files.
This diff is collapsed.
This diff is collapsed.
......@@ -7,15 +7,21 @@ theme_sources = files([
'gnome-shell-sass/_high-contrast-colors.scss'
])
styles = [
'gnome-shell-high-contrast',
'gnome-shell'
]
theme_deps = []
if sassc.found()
parse_sass = files('parse-sass.sh')
theme_deps += custom_target('update-theme',
output: 'theme-update.stamp',
depend_files: theme_sources,
command: [parse_sass, '@OUTPUT@'],
build_by_default: true
)
foreach style: styles
theme_deps += custom_target('style-' + style,
input: '@0@.scss'.format(style),
output: '@0@.css'.format(style),
command: [
sassc, '-a', '@INPUT@', '@OUTPUT@'
],
depend_files: theme_sources)
endforeach
endif
#!/bin/sh
srcdir=`dirname $0`
stamp=${1}
for scss in $srcdir/*.scss
do
sassc -a $scss ${scss%%.scss}.css || exit 1
done
[ "$stamp" ] && touch $stamp
......@@ -138,7 +138,7 @@ endif
mutter_typelibdir = mutter_dep.get_pkgconfig_variable('typelibdir')
python = find_program('python3')
sassc = find_program('sassc', required: false)
sassc = find_program('sassc', required: true)
cc = meson.get_compiler('c')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment