Socket
Socket
Sign inDemoInstall

postcss-nested

Package Overview
Dependencies
6
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.2 to 4.2.0

index.d.ts

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 4.2
* Add `@at-root` support (by Jason Quense).
## 4.1.2

@@ -5,0 +8,0 @@ * Improve error messsage on broken selector

@@ -73,3 +73,3 @@ var postcss = require('postcss')

children.push(child)
} if (child.type === 'decl') {
} else if (child.type === 'decl') {
children.push(child)

@@ -96,2 +96,3 @@ } else if (child.type === 'rule' && bubbling) {

var after = rule
rule.each(function (child) {

@@ -105,4 +106,19 @@ if (child.type === 'rule') {

} else if (child.type === 'atrule') {
if (bubble[child.name]) {
if (child.name === 'at-root') {
unwrapped = true
atruleChilds(rule, child, false)
var nodes = child.nodes
if (child.params) {
nodes = postcss.rule({
selector: child.params,
nodes: nodes
})
}
after.after(nodes)
after = nodes
child.remove()
} else if (bubble[child.name]) {
unwrapped = true
atruleChilds(rule, child, true)

@@ -109,0 +125,0 @@ after = pickComment(child.prev(), after)

6

package.json
{
"name": "postcss-nested",
"version": "4.1.2",
"version": "4.2.0",
"description": "PostCSS plugin to unwrap nested rules like how Sass does it",

@@ -16,5 +16,5 @@ "keywords": [

"dependencies": {
"postcss": "^7.0.14",
"postcss-selector-parser": "^5.0.0"
"postcss": "^7.0.21",
"postcss-selector-parser": "^6.0.2"
}
}

@@ -1,2 +0,2 @@

# PostCSS Nested [![Build Status][ci-img]][ci]
# PostCSS Nested

@@ -24,2 +24,11 @@ <img align="right" width="135" height="95"

}
.title {
font-size: var(--font);
@at-root html {
--font: 16px
}
}
}
```

@@ -44,11 +53,23 @@

}
.title {
font-size: var(--font);
}
html {
--font: 16px
}
```
Use [postcss-current-selector] **after** this plugin if you want to use current selector in properties or variables values.
Related plugins:
Use [postcss-nested-ancestors] **before** this plugin if you want to reference any ancestor element directly in your selectors with `^&`.
* Use [`postcss-current-selector`] **after** this plugin if you want
to use current selector in properties or variables values.
* Use [`postcss-nested-ancestors`] **before** this plugin if you want
to reference any ancestor element directly in your selectors with `^&`.
See also [postcss-nesting], which implements [Tab Atkin's proposed syntax](https://tabatkins.github.io/specs/css-nesting/) (requires the `&` and introduces `@nest`).
Alternatives:
There is also [postcss-nested-props] for nested properties like `font-size`.
* See also [`postcss-nesting`], which implements [CSSWG draft]
(requires the `&` and introduces `@nest`).
* [`postcss-nested-props`] for nested properties like `font-size`.

@@ -59,9 +80,8 @@ <a href="https://evilmartians.com/?utm_source=postcss-nested">

[postcss-current-selector]: https://github.com/komlev/postcss-current-selector
[postcss-nested-ancestors]: https://github.com/toomuchdesign/postcss-nested-ancestors
[postcss-nested-props]: https://github.com/jedmao/postcss-nested-props
[postcss-nesting]: https://github.com/jonathantneal/postcss-nesting
[`postcss-current-selector`]: https://github.com/komlev/postcss-current-selector
[`postcss-nested-ancestors`]: https://github.com/toomuchdesign/postcss-nested-ancestors
[`postcss-nested-props`]: https://github.com/jedmao/postcss-nested-props
[`postcss-nesting`]: https://github.com/jonathantneal/postcss-nesting
[CSSWG draft]: https://drafts.csswg.org/css-nesting-1/
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/postcss/postcss-nested.svg
[ci]: https://travis-ci.org/postcss/postcss-nested

@@ -68,0 +88,0 @@ ## Usage

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc