Socket
Socket
Sign inDemoInstall

postcss-nesting

Package Overview
Dependencies
1
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 4.0.0

5

CHANGELOG.md
# Changes to PostCSS Nesting
### 4.0.0 (May 20, 2017)
- Transform only compliant nesting
- Preserve more raws formatting
### 3.0.0 (May 8, 2017)

@@ -4,0 +9,0 @@

6

lib/clean-node.js
// clean the raws of the node
module.exports = (node) => {
node.raws = {};
node.raws = Object.assign(
node.raws.between ? { between: node.raws.between } : {},
node.raws.semicolon ? { semicolon: true } : {},
node.raws.important ? { important: node.raws.important } : {}
);
return node;
};

@@ -25,2 +25,8 @@ // tooling

// swap semicolon raws
const semicolon = node.raws.semicolon;
node.raws.semicolon = node.parent.raws.semicolon;
node.parent.raws.semicolon = semicolon;
// move the node after the parent

@@ -27,0 +33,0 @@ const parent = node.parent.after(node);

2

lib/transform-nesting-atrule.js

@@ -42,3 +42,3 @@ // tooling

module.exports.test = (node) => node.type === 'atrule' && node.name === 'nest' && node.parent && node.parent.type === 'rule' && comma(node.params).every(
(childNode) => childNode.indexOf('&') !== -1
(selector) => selector.split('&').length === 2 && /&([^A-z]|$)/.test(selector)
);

@@ -28,3 +28,3 @@ // tooling

module.exports.test = (node) => node.type === 'rule' && node.parent && node.parent.type === 'rule' && node.selectors.every(
(childNode) => childNode.trim()[0] === '&'
(selector) => selector.trim().lastIndexOf('&') === 0 && /^&([^A-z]|$)/.test(selector)
);
{
"name": "postcss-nesting",
"version": "3.0.0",
"version": "4.0.0",
"description": "Nest style and media rules inside each another, following the CSS Nesting Module Level 3 specification",

@@ -5,0 +5,0 @@ "author": "Jonathan Neal <jonathantneal@hotmail.com>",

@@ -60,3 +60,3 @@ # PostCSS Nesting [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]

postcss([
require('postcss-nesting')({ /* options */ })
require('postcss-nesting')({ /* options */ })
]).process(YOUR_CSS, /* options */);

@@ -79,9 +79,9 @@ ```

gulp.task('css', function () {
return gulp.src('./src/*.css').pipe(
postcss([
require('postcss-nesting')({ /* options */ })
])
).pipe(
gulp.dest('.')
);
return gulp.src('./src/*.css').pipe(
postcss([
require('postcss-nesting')({ /* options */ })
])
).pipe(
gulp.dest('.')
);
});

@@ -104,12 +104,12 @@ ```

grunt.initConfig({
postcss: {
options: {
use: [
require('postcss-nesting')({ /* options */ })
]
},
dist: {
src: '*.css'
}
}
postcss: {
options: {
use: [
require('postcss-nesting')({ /* options */ })
]
},
dist: {
src: '*.css'
}
}
});

@@ -116,0 +116,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc