From 8209144cdfdeb0028badbea3fe81a2dc5a5ec03f Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 11 Jul 2022 00:10:53 +0300 Subject: build_static: change order of css transformations --- build_static.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'build_static.php') diff --git a/build_static.php b/build_static.php index a9ec027..39b8e19 100755 --- a/build_static.php +++ b/build_static.php @@ -56,13 +56,8 @@ function build_static(): void { foreach ($entries as $entry) { $input = ROOT.'/htdocs/scss/entries/'.$entry.'/'.$theme.'.scss'; $output = $css_dir.'/'.$entry.($theme == 'dark' ? '_dark' : '').'.css'; - if (sassc($input, $output) != 0) { + if (sassc($input, $output) != 0) fwrite(STDERR, "error: could not compile entries/$entry/$theme.scss\n"); - continue; - } - - // 1.1. apply clean-css optimizations and transformations - clean_css($output); } } @@ -71,6 +66,10 @@ function build_static(): void { $light_file = $css_dir.'/'.$entry.'.css'; $dark_file = str_replace('.css', '_dark.css', $light_file); dark_diff($light_file, $dark_file); + + // 2.1. apply cleancss (must be done _after_ css-patch) + clean_css($light_file); + clean_css($dark_file); } // 3. calculate hashes -- cgit v1.2.3