Commit ee408d5f authored by Emmanuele Bassi's avatar Emmanuele Bassi

meson: Rebuild the SCSS-based themes if sassc is available

If we have sassc installed then we want to rebuild the themes that use
SCSS whenever one of their dependencies change.
parent 6f71c543
......@@ -680,9 +680,24 @@ gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
outfile
])
# Re-build the theme files if sassc is available
theme_deps = []
sassc = find_program('sassc', required: false)
if sassc.found()
sassc_opts = [ '-a', '-M', '-t', 'compact' ]
subdir('theme/Adwaita')
subdir('theme/HighContrast')
endif
gtkresources = gnome.compile_resources('gtkresources',
gtk_gresources_xml,
source_dir: meson.current_source_dir(),
dependencies: theme_deps,
source_dir: [
# List in order of preference
meson.current_build_dir(),
meson.current_source_dir(),
],
c_name: '_gtk',
extra_args: '--manual-register')
......
scss_files = files([
'_colors-public.scss',
'_colors.scss',
'_common.scss',
'_drawing.scss',
])
theme_variants = [
'dark',
]
theme_deps += custom_target('Adwaita',
input: 'gtk-contained.scss',
output: 'gtk-contained.css',
command: [
sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
],
depend_files: scss_files,
build_by_default: true)
foreach variant: theme_variants
theme_deps += custom_target('Adwaita-' + variant,
input: 'gtk-contained-@0@.scss'.format(variant),
output: 'gtk-contained-@0@.css'.format(variant),
command: [
sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
],
depend_files: scss_files,
build_by_default: true)
endforeach
scss_files = files([
'_colors.scss',
'_common.scss',
'_drawing.scss',
])
theme_variants = [
'inverse',
]
theme_deps += custom_target('HighContrast',
input: 'gtk-contained.scss',
output: 'gtk-contained.css',
command: [
sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
],
depend_files: scss_files,
build_by_default: true)
foreach variant: theme_variants
theme_deps += custom_target('HighContrast-' + variant,
input: 'gtk-contained-@0@.scss'.format(variant),
output: 'gtk-contained-@0@.css'.format(variant),
command: [
sassc, sassc_opts, '@INPUT@', '@OUTPUT@',
],
depend_files: scss_files,
build_by_default: true)
endforeach
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