less-openui5
Advanced tools
Comparing version 0.11.3 to 0.11.4
@@ -14,2 +14,3 @@ "use strict"; | ||
this.parenStack = []; | ||
this.fontFaceDirectiveStack = []; | ||
}; | ||
@@ -24,4 +25,4 @@ | ||
_isInMixinOrParen() { | ||
return this.mixinStack.length > 0 || this.parenStack.length > 0; | ||
_isInMixinOrParenOrFontFaceDirective() { | ||
return this.mixinStack.length > 0 || this.parenStack.length > 0 || this.fontFaceDirectiveStack.length > 0; | ||
}, | ||
@@ -44,3 +45,3 @@ | ||
_isRelevant() { | ||
return !this._isInMixinOrParen() && this._isVarInRule(); | ||
return !this._isInMixinOrParenOrFontFaceDirective() && this._isVarInRule(); | ||
}, | ||
@@ -159,3 +160,3 @@ | ||
const isVarDeclaration = typeof node.name === "string" && node.name.startsWith("@"); | ||
if (!this._isInMixinOrParen() && isVarDeclaration) { | ||
if (!this._isInMixinOrParenOrFontFaceDirective() && isVarDeclaration) { | ||
// add the variable declaration to the list of vars | ||
@@ -206,2 +207,18 @@ const varName = node.name.substr(1); | ||
visitDirective(node, visitArgs) { | ||
// store the @font-face directive context | ||
if (node.name === "@font-face") { | ||
this.fontFaceDirectiveStack.push(node); | ||
} | ||
return node; | ||
}, | ||
visitDirectiveOut(node) { | ||
// remove @font-face directive context | ||
if (node.name === "@font-face") { | ||
this.fontFaceDirectiveStack.pop(); | ||
} | ||
return node; | ||
}, | ||
visitUrl(node, visitArgs) { | ||
@@ -208,0 +225,0 @@ // we mark the less variables which should be updated after eval |
{ | ||
"name": "less-openui5", | ||
"version": "0.11.3", | ||
"version": "0.11.4", | ||
"description": "Build OpenUI5 themes with Less.js", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
360454
8340