2021-03-09 16:22:17 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
testGlobalCss();
|
|
|
|
|
|
|
|
function testGlobalCss() {
|
|
|
|
const css = fs.readFileSync('global.css', {encoding: 'utf8'});
|
2021-04-19 13:01:36 +00:00
|
|
|
const ERR = 'global.css: missing the transition suppressor rule';
|
2021-04-20 17:27:07 +00:00
|
|
|
const RX_SUPPRESSOR = /[^{}]+#\\1\s?transition-suppressor[^{}]+{\s*transition:\s*none\s*!\s*important/i;
|
2022-07-23 20:54:24 +00:00
|
|
|
const RX_COMMENT = /\/\*([^*]+|\*(?!\/))*(\*\/|$)/g;
|
2021-03-09 16:22:17 +00:00
|
|
|
if (!RX_SUPPRESSOR.test(css.replace(RX_COMMENT, ''))) {
|
|
|
|
console.error(ERR);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|