summaryrefslogtreecommitdiff
path: root/build_static.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-11 00:10:53 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-11 00:10:53 +0300
commit8209144cdfdeb0028badbea3fe81a2dc5a5ec03f (patch)
treeb6c68f007c546f8e7390ac8da06c73a4c04f3db0 /build_static.php
parente34ea03ae31072c92a7679558f03cf988f932778 (diff)
build_static: change order of css transformations
Diffstat (limited to 'build_static.php')
-rwxr-xr-xbuild_static.php11
1 files changed, 5 insertions, 6 deletions
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