don't add usercss vars to empty sections
This commit is contained in:
parent
fb3554a351
commit
0e518bddcb
|
@ -1,4 +1,4 @@
|
||||||
/* global loadScript mozParser semverCompare colorParser */
|
/* global loadScript mozParser semverCompare colorParser styleCodeEmpty */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
|
@ -30,9 +30,10 @@ var usercss = (() => {
|
||||||
':root {\n' +
|
':root {\n' +
|
||||||
Object.keys(vars).map(k => ` --${k}: ${vars[k].value};\n`).join('') +
|
Object.keys(vars).map(k => ` --${k}: ${vars[k].value};\n`).join('') +
|
||||||
'}\n';
|
'}\n';
|
||||||
|
|
||||||
for (const section of sections) {
|
for (const section of sections) {
|
||||||
section.code = varDef + section.code;
|
if (!styleCodeEmpty(section.code)) {
|
||||||
|
section.code = varDef + section.code;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user