javascript:S7770
This commit is contained in:
parent
5ce2ce63be
commit
11c4239ceb
10 changed files with 19 additions and 19 deletions
|
|
@ -126,7 +126,7 @@ const generateTheme = (inputRuleset, callbacks, debug) => {
|
|||
const chunk = chunks[counter]
|
||||
Promise.all(chunk.map((x) => x())).then((result) => {
|
||||
getCssRules(
|
||||
result.filter((x) => x),
|
||||
result.filter(Boolean),
|
||||
debug,
|
||||
).forEach((rule) => {
|
||||
onNewRule(rule, true)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export const getCssRules = (rules, debug) =>
|
|||
: '',
|
||||
' --background: ' + v,
|
||||
]
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.join(';\n')
|
||||
}
|
||||
const color = getCssColorString(
|
||||
|
|
@ -115,7 +115,7 @@ export const getCssRules = (rules, debug) =>
|
|||
if (rule.directives.backgroundNoCssColor !== 'yes') {
|
||||
cssDirectives.push('background-color: ' + color)
|
||||
}
|
||||
return cssDirectives.filter((x) => x).join(';\n')
|
||||
return cssDirectives.filter(Boolean).join(';\n')
|
||||
}
|
||||
case 'blur': {
|
||||
const cssDirectives = []
|
||||
|
|
@ -157,7 +157,7 @@ export const getCssRules = (rules, debug) =>
|
|||
return null
|
||||
}
|
||||
})
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.map((x) => ' ' + x + ';')
|
||||
.join('\n')
|
||||
|
||||
|
|
@ -172,10 +172,10 @@ export const getCssRules = (rules, debug) =>
|
|||
virtualDirectives,
|
||||
footer,
|
||||
]
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.join('\n')
|
||||
})
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
|
||||
export const getScopedVersion = (rules, newScope) => {
|
||||
return rules.map((x) => {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,6 @@ export const serialize = (ruleset) => {
|
|||
|
||||
return `${header} {\n${content.join(';\n')}\n}`
|
||||
})
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.join('\n\n')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -558,9 +558,9 @@ export const convertTheme2To3 = (data) => {
|
|||
)
|
||||
|
||||
const flatExtRules = extendedRules
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.reduce((acc, x) => [...acc, ...x], [])
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
.reduce((acc, x) => [...acc, ...x], [])
|
||||
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -338,10 +338,10 @@ export const init = ({
|
|||
const relevantRules = ruleset.filter((r) => r.component === component.name)
|
||||
const backgrounds = relevantRules
|
||||
.map((r) => r.directives.background)
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
const opacities = relevantRules
|
||||
.map((r) => r.directives.opacity)
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
if (
|
||||
backgrounds.some((x) => x.match(/--parent/)) ||
|
||||
opacities.some((x) => x != null && x < 1)
|
||||
|
|
@ -596,7 +596,7 @@ export const init = ({
|
|||
const shadow = value
|
||||
.split(/,/g)
|
||||
.map((s) => s.trim())
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
dynamicVars[k] = shadow
|
||||
if (combination.component === rootComponentName) {
|
||||
staticVars[k.substring(2)] = shadow
|
||||
|
|
@ -752,7 +752,7 @@ export const init = ({
|
|||
return processCombination(combination)
|
||||
}
|
||||
})
|
||||
.filter((x) => x)
|
||||
.filter(Boolean)
|
||||
const t2 = performance.now()
|
||||
if (debug) {
|
||||
console.debug('Eager processing took ' + (t2 - t1) + ' ms')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue