postcss-mixins
Advanced tools
Comparing version 7.0.3 to 8.0.0
22
index.js
@@ -14,3 +14,3 @@ let { join, basename, extname, relative } = require('path') | ||
function addMixin (helpers, mixins, rule, file) { | ||
function addMixin(helpers, mixins, rule, file) { | ||
let name = rule.params.split(/\s/, 1)[0] | ||
@@ -39,3 +39,3 @@ let other = rule.params.slice(name.length).trim() | ||
async function loadGlobalMixin (helpers, globs) { | ||
async function loadGlobalMixin(helpers, globs) { | ||
let cwd = process.cwd() | ||
@@ -68,3 +68,3 @@ let files = await globby(globs, { caseSensitiveMatch: IS_WIN }) | ||
function addGlobalMixins (helpers, local, global, parent) { | ||
function addGlobalMixins(helpers, local, global, parent) { | ||
for (let name in global) { | ||
@@ -80,3 +80,3 @@ helpers.result.messages.push({ | ||
function processMixinContent (rule, from) { | ||
function processMixinContent(rule, from) { | ||
rule.walkAtRules('mixin-content', content => { | ||
@@ -91,3 +91,3 @@ if (from.nodes && from.nodes.length > 0) { | ||
function insertObject (rule, obj) { | ||
function insertObject(rule, obj) { | ||
let root = parse(obj) | ||
@@ -101,6 +101,12 @@ root.each(node => { | ||
function insertMixin (helpers, mixins, rule, opts) { | ||
function insertMixin(helpers, mixins, rule, opts) { | ||
let name = rule.params.split(/\s/, 1)[0] | ||
let rest = rule.params.slice(name.length).trim() | ||
if (name.includes('(')) { | ||
throw rule.error( | ||
'Remove brackets from mixin. Like: @mixin name(1px) → @mixin name 1px' | ||
) | ||
} | ||
let params | ||
@@ -174,3 +180,3 @@ if (rest.trim() === '') { | ||
prepare () { | ||
prepare() { | ||
let mixins = {} | ||
@@ -185,3 +191,3 @@ | ||
return { | ||
Once (root, helpers) { | ||
Once(root, helpers) { | ||
if (loadFrom.length > 0) { | ||
@@ -188,0 +194,0 @@ return loadGlobalMixin(helpers, loadFrom).then(global => { |
{ | ||
"name": "postcss-mixins", | ||
"version": "7.0.3", | ||
"version": "8.0.0", | ||
"description": "PostCSS plugin for mixins", | ||
@@ -16,3 +16,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=10.0" | ||
"node": ">=12.0" | ||
}, | ||
@@ -24,6 +24,6 @@ "funding": { | ||
"peerDependencies": { | ||
"postcss": "^8.2.0" | ||
"postcss": "^8.2.14" | ||
}, | ||
"dependencies": { | ||
"globby": "^11.0.2", | ||
"globby": "^11.0.3", | ||
"postcss-js": "^3.0.3", | ||
@@ -30,0 +30,0 @@ "postcss-simple-vars": "^6.0.3", |
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
182
14173
4
Updatedglobby@^11.0.3