postcss-advanced-variables
Advanced tools
Comparing version
# Changes to PostCSS Advanced Variables | ||
### 3.0.1 (February 27, 2020) | ||
- Fixed: parsing the contents of imported stylesheets (#71) | ||
### 3.0.0 (November 22, 2018) | ||
@@ -4,0 +8,0 @@ |
13
index.js
@@ -138,2 +138,6 @@ 'use strict'; | ||
function _iterableToArrayLimit(arr, i) { | ||
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { | ||
return; | ||
} | ||
var _arr = []; | ||
@@ -304,4 +308,8 @@ var _n = true; | ||
cwf = _getImportOpts.cwf, | ||
cwd = _getImportOpts.cwd; | ||
cwd = _getImportOpts.cwd; // PostCSS options | ||
const options = opts.result.opts; | ||
const parser = options.parser || options.syntax && options.syntax.parse || null; | ||
if (opts.importFilter instanceof Function && opts.importFilter(id, media) || opts.importFilter instanceof RegExp && opts.importFilter.test(id)) { | ||
@@ -316,3 +324,4 @@ const cwds = [cwd].concat(opts.importPaths); // promise the resolved file and its contents using the file resolver | ||
}) => processor.process(contents, { | ||
from: file | ||
from: file, | ||
parser: parser | ||
}).then(({ | ||
@@ -319,0 +328,0 @@ root |
{ | ||
"name": "postcss-advanced-variables", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Use Sass-like variables, conditionals, and iterators in CSS", | ||
@@ -5,0 +5,0 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>", |
@@ -523,3 +523,7 @@ # PostCSS Advanced Variables [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss] | ||
The `importFilter` option can be a function or an regular expression. | ||
The value can be a function or an regular expression. When | ||
providing a function, it is called with a single string argument `id` | ||
and returns true when the import should be inlined. When providing a | ||
regular expression, if the `id` matches the expression, the import will | ||
be inlined. | ||
@@ -531,3 +535,5 @@ By default, imports are ignored if they begin with a protocol or | ||
require('postcss-advanced-variables')({ | ||
importPaths: ['path/to/files', 'another/path/to/files'] | ||
importFilter: (id) => { | ||
return ['ignore', 'these', 'imports'].contains(id); | ||
} | ||
}); | ||
@@ -534,0 +540,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68956
1.35%1045
1.16%577
1.05%0
-100%