Improve animated film bird

This commit is contained in:
KoalaDev
2026-07-12 03:28:05 +02:00
parent ea0970df72
commit c7c124dac7
5 changed files with 215 additions and 143 deletions
+7 -1
View File
@@ -13,11 +13,17 @@ const { optimize: svgoOptimize } = require('svgo');
function minifyCSS(code) {
return code
.replace(/\/\*[\s\S]*?\*\//g, '')
.replace(/\s*([{}:;,])\s*/g, '$1')
// Never strip whitespace before `:`: `.parent :is(...)` is a
// descendant selector, while `.parent:is(...)` targets the parent.
.replace(/\s*([{},;])\s*/g, '$1')
.replace(/:\s+/g, ':')
.replace(/\s+/g, ' ')
.replace(/;\}/g, '}')
.trim();
}
if (minifyCSS('.parent :is(.a, .b) { color: red; }') !== '.parent :is(.a,.b){color:red}') {
throw new Error('CSS minifier must preserve descendant combinators before functional pseudo-classes');
}
const MIN_AVIF_KB = 0;
function copyDirSync(src, dest) {