postcss-merge-rules
Advanced tools
Comparing version
@@ -0,1 +1,7 @@ | ||
# 1.3.1 | ||
* Fixes a behaviour in which rule adjacent forward nodes were not being type | ||
checked before they were merged. | ||
* Compatibility fixes for the PostCSS plugin guidelines. | ||
# 1.3.0 | ||
@@ -2,0 +8,0 @@ |
@@ -76,3 +76,3 @@ 'use strict'; | ||
var nextRule = second.next(); | ||
if (nextRule) { | ||
if (nextRule && nextRule.type !== 'comment') { | ||
var nextIntersection = intersect(getDeclarations(second), getDeclarations(nextRule)); | ||
@@ -79,0 +79,0 @@ if (nextIntersection.length > intersection.length) { |
{ | ||
"name": "postcss-merge-rules", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Merge CSS rules with PostCSS.", | ||
@@ -14,10 +14,10 @@ "main": "index.js", | ||
"postcss", | ||
"postcss-plugins" | ||
"postcss-plugin" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"jshint": "^2.6.3", | ||
"jshint-stylish": "^1.0.1", | ||
"tap-spec": "^2.2.2", | ||
"tape": "^3.5.0" | ||
"jshint": "^2.8.0", | ||
"jshint-stylish": "^2.0.1", | ||
"tap-spec": "^4.0.2", | ||
"tape": "^4.0.0" | ||
}, | ||
@@ -36,4 +36,4 @@ "homepage": "https://github.com/ben-eb/postcss-merge-rules", | ||
"flatten": "0.0.1", | ||
"postcss": "^4.1.2" | ||
"postcss": "^4.1.16" | ||
} | ||
} |
@@ -5,4 +5,6 @@ # [postcss][postcss]-merge-rules [][ci] [][npm] [][deps] | ||
Install via [npm](https://npmjs.org/package/postcss-merge-rules): | ||
## Install | ||
With [npm](https://npmjs.org/package/postcss-merge-rules) do: | ||
``` | ||
@@ -12,14 +14,4 @@ npm install postcss-merge-rules --save | ||
## Example | ||
## Examples | ||
```js | ||
var postcss = require('postcss'); | ||
var mergeRules = require('postcss-merge-rules'); | ||
var css = 'a{color:blue}a{font-weight:bold}'; | ||
console.log(postcss(mergeRules()).process(css).css); | ||
// => 'a{color:blue;font-weight:bold}' | ||
``` | ||
This module will attempt to merge *adjacent* CSS rules: | ||
@@ -29,2 +21,4 @@ | ||
#### Input | ||
```css | ||
@@ -42,3 +36,3 @@ a { | ||
Becomes: | ||
#### Output | ||
@@ -54,2 +48,4 @@ ```css | ||
#### Input | ||
```css | ||
@@ -65,3 +61,3 @@ a { | ||
Becomes: | ||
#### Output | ||
@@ -77,2 +73,4 @@ ```css | ||
#### Input | ||
```css | ||
@@ -89,3 +87,3 @@ a { | ||
Becomes: | ||
#### Output | ||
@@ -102,2 +100,7 @@ ```css | ||
## Usage | ||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for | ||
examples for your environment. | ||
## Contributing | ||
@@ -110,3 +113,3 @@ | ||
MIT © Ben Briggs | ||
MIT © [Ben Briggs](http://beneb.info) | ||
@@ -113,0 +116,0 @@ [ci]: https://travis-ci.org/ben-eb/postcss-merge-rules |
Sorry, the diff of this file is not supported yet
10581
2.02%110
2.8%Updated