From 0e518bddcb8e455197c4d3be10fc9bc9364467b4 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 26 Nov 2017 04:52:14 +0300 Subject: [PATCH] don't add usercss vars to empty sections --- js/usercss.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/usercss.js b/js/usercss.js index 0a4edd21..2f3298a6 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -1,4 +1,4 @@ -/* global loadScript mozParser semverCompare colorParser */ +/* global loadScript mozParser semverCompare colorParser styleCodeEmpty */ 'use strict'; // eslint-disable-next-line no-var @@ -30,9 +30,10 @@ var usercss = (() => { ':root {\n' + Object.keys(vars).map(k => ` --${k}: ${vars[k].value};\n`).join('') + '}\n'; - for (const section of sections) { - section.code = varDef + section.code; + if (!styleCodeEmpty(section.code)) { + section.code = varDef + section.code; + } } } },