Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 64b903f

Browse files
committed
Added: support for :not() selector pseudo class level 4 (transpiled to level 3)
1 parent 0cf0c13 commit 64b903f

File tree

8 files changed

+22
-0
lines changed

8 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# 1.4.0 - 2015-05-01
12

23
- Added: support for `:matches()` selector pseudo class
4+
- Added: support for `:not()` selector pseudo class level 4 (transpiled to level 3)
35

46
# 1.3.1 - 2015-05-01
57

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ properties (fallback: inlined `<svg>` filter)
8585
([](https://github.com/axa-ch/postcss-pseudoelements))
8686
* [`:matches` pseudo-class](http://dev.w3.org/csswg/selectors-4/#matches)
8787
([](https://github.com/postcss/postcss-selector-matches))
88+
* [`:not` pseudo-class](http://dev.w3.org/csswg/selectors-4/#negation)
89+
([](https://github.com/postcss/postcss-selector-NOT))
8890
* alpha colors for browser that don't understand [css 3 colors](http://www.w3.org/TR/css3-color/)
8991
(fallback: solid hexa colors)
9092
([](https://github.com/postcss/postcss-color-rgba-fallback))
@@ -281,6 +283,7 @@ Here are all the available features:
281283
- `rem`
282284
- `pseudoElements`
283285
- `pseudoClassMatches`
286+
- `pseudoClassNot`
284287
- `colorRgba`
285288
- `autoprefixer`
286289

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var caniuseFeaturesMap = {
2626
rem: ["rem"],
2727
pseudoElements: ["css-gencontent"],
2828
// pseudoClassMatches: [null],
29+
// pseudoClassNot: [null],
2930
colorRgba: ["css3-colors"],
3031
// autoprefixer: [null] // will always be null since autoprefixer does the same game as we do
3132
}
@@ -47,6 +48,7 @@ var features = {
4748
rem: function(options) { return require("pixrem")(options)},
4849
pseudoElements: function(options) { return require("postcss-pseudoelements")(options)},
4950
pseudoClassMatches: function(options) { return require("postcss-selector-matches")(options)},
51+
pseudoClassNot: function(options) { return require("postcss-selector-not")(options)},
5052
colorRgba: function(options) { return require("postcss-color-rgba-fallback")(options)},
5153
autoprefixer: function(options) { return require("autoprefixer-core")(options).postcss}
5254
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"postcss-media-minmax": "^1.1.0",
5454
"postcss-pseudoelements": "^2.1.1",
5555
"postcss-selector-matches": "^1.0.1",
56+
"postcss-selector-not": "^1.0.1",
5657
"postcss-url": "^3.0.0",
5758
"read-file-stdin": "^0.2.0",
5859
"to-slug-case": "^0.1.2",

test/fixtures/cases/example.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ a::after {
5959
content: "pseudo-elements"
6060
}
6161

62+
/* :matches() and :not() */
6263
p:matches(:first-child, .specific) {
6364
color: red;
6465
}
66+
p:not(:first-child, .specific) {
67+
background: blue;
68+
}
6569

6670
/* rgba() fallback */
6771
.color {

test/fixtures/cases/example.expected.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ a:after {
7171
content: "pseudo-elements"
7272
}
7373

74+
/* :matches() and :not() */
7475
p:first-child, p.specific {
7576
color: red;
7677
}
78+
p:not(:first-child), p:not(.specific) {
79+
background: blue;
80+
}
7781

7882
/* rgba() fallback */
7983
.color {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
p:not(:first-child, .specific) {
2+
background: blue;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
p:not(:first-child), p:not(.specific) {
2+
background: blue;
3+
}

0 commit comments

Comments
 (0)