Skip to content

Commit

Permalink
update batch
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jul 23, 2024
1 parent b4c7e17 commit 7de8a56
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# postcss-resolve-nested-selector

[![Build Status](https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector.svg?branch=master)](https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector)
[![test](https://github.com/csstools/postcss-resolve-nested-selector/actions/workflows/test.yml/badge.svg)](https://github.com/csstools/postcss-resolve-nested-selector/actions/workflows/test.yml)

Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.

Tested to work with the syntax of
[postcss-nested](https://github.com/postcss/postcss-nested)
and [postcss-nesting](https://github.com/jonathantneal/postcss-nesting).
and [postcss-nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting).
Should also work with SCSS and Less syntax. If you'd like to help out by
adding some automated tests for those, that'd be swell. In fact, if you'd
like to add any automated tests, you are a winner!
Expand All @@ -22,19 +22,19 @@ For example, given this JS:
```js
var resolvedNestedSelector = require('postcss-resolve-nested-selector');
postcssRoot.eachRule(function(rule) {
rule.selectors.forEach(function(selector) {
console.log(resolvedNestedSelector(selector, rule));
});
rule.selectors.forEach(function(selector) {
console.log(resolvedNestedSelector(selector, rule));
});
});
```

And the following CSS:

```scss
.foo {
.bar {
color: pink;
}
.bar {
color: pink;
}
}
```

Expand All @@ -49,10 +49,10 @@ Or with this CSS:

```scss
.foo {
.bar &,
a {
color: pink;
}
.bar &,
a {
color: pink;
}
}
```

Expand Down

0 comments on commit 7de8a56

Please sign in to comment.