postcss-css-variables
Advanced tools
Comparing version
# v0.7.0 - 2017-3-12 | ||
- Resolve `var` usage in fallbacks, [#37](https://github.com/MadLittleMods/postcss-css-variables/issues/37) | ||
- Thank you to [@asvny](https://github.com/asvny) and [@marklu](https://github.com/marklu) for the contribution, [#39](https://github.com/MadLittleMods/postcss-css-variables/issues/39) -> [#49](https://github.com/MadLittleMods/postcss-css-variables/pull/49) | ||
# v0.6.0 - 2016-9-23 | ||
@@ -3,0 +9,0 @@ |
@@ -0,0 +0,0 @@ // PostCSS CSS Variables (postcss-css-variables) |
@@ -65,3 +65,12 @@ var generateScopeList = require('./generate-scope-list'); | ||
// Default to the calculatedInPlaceValue which might be a previous fallback, then try this declarations fallback | ||
var replaceValue = (matchingVarDeclMapItem || {}).calculatedInPlaceValue || fallback; | ||
var replaceValue = (matchingVarDeclMapItem || {}).calculatedInPlaceValue || (function() { | ||
// Resolve `var` values in fallback | ||
var fallbackValue = fallback; | ||
if(fallback) { | ||
var fallbackDecl = decl.clone({ parent: decl.parent, value: fallback }); | ||
fallbackValue = resolveValue(fallbackDecl, map, false, true).value; | ||
} | ||
return fallbackValue; | ||
})(); | ||
// Otherwise if the dependency health is good(no circular or self references), dive deeper and resolve | ||
@@ -68,0 +77,0 @@ if(matchingVarDeclMapItem !== undefined && !gatherVariableDependencies(variablesUsedInValue, map).hasCircularOrSelfReference) { |
{ | ||
"name": "postcss-css-variables", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -86,3 +86,3 @@ # PostCSS CSS Variables | ||
```css | ||
:root: { | ||
:root { | ||
--some-color: red; | ||
@@ -89,0 +89,0 @@ } |
53051
0.81%801
1.01%