postcss-mixins
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -0,1 +1,4 @@ | ||
## 5.0.1 | ||
* Use globby 6 and PostCSS 5.1. | ||
## 5.0 | ||
@@ -2,0 +5,0 @@ * Use `postcss-simple-vars` 3.0 with special syntax for comment variables |
{ | ||
"name": "postcss-mixins", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "PostCSS plugin for mixins", | ||
@@ -18,9 +18,9 @@ "keywords": [ | ||
"postcss-js": "^0.1.3", | ||
"postcss": "^5.0.21", | ||
"globby": "^5.0.0" | ||
"postcss": "^5.1.2", | ||
"globby": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-postcss": "^2.0.2", | ||
"eslint": "^2.13.1", | ||
"ava": "^0.15.2" | ||
"eslint": "^3.3.0", | ||
"ava": "^0.16.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
@@ -147,3 +147,3 @@ # PostCSS Mixins [![Build Status][ci-img]][ci] | ||
mixins: { | ||
hidpi: function (path) { | ||
image: function (mixin, path) { | ||
return { | ||
@@ -164,2 +164,18 @@ '&': { | ||
Mixin body will be in `mixin.nodes`: | ||
``` | ||
var postcss = require('postcss'); | ||
require('postcss-mixins')({ | ||
mixins: { | ||
hover: function (mixin) { | ||
let rule = postcss.rule({ selector: '&:hover', '&.hover' }); | ||
rule.append(mixin.nodes); | ||
mixin.replaceWith(rule); | ||
} | ||
} | ||
} | ||
``` | ||
Or you can use object instead of function: | ||
@@ -183,14 +199,2 @@ | ||
**Note**: When you need to pass arguments to a mixin, ensure you pass `rule` | ||
as your first argument. For example: | ||
````js | ||
spinner: function (rule, background, highlight) { | ||
return { | ||
border: '2px solid ' + background, | ||
borderLeftColor: highlight | ||
}; | ||
} | ||
```` | ||
## Options | ||
@@ -197,0 +201,0 @@ |
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
14680
260
+ Addedglobby@6.1.0(transitive)
- Removedarrify@1.0.1(transitive)
- Removedglobby@5.0.0(transitive)
Updatedglobby@^6.0.0
Updatedpostcss@^5.1.2