File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
plugins/postcss-selector-not Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ function explodeSelector(pseudoClass, selector) {
8
8
if ( selector && position > - 1 ) {
9
9
const pre = selector . slice ( 0 , position )
10
10
const matches = balancedMatch ( "(" , ")" , selector . slice ( position ) )
11
+
12
+ if ( ! matches ) {
13
+ return selector
14
+ }
15
+
11
16
const bodySelectors = matches . body
12
17
? list
13
18
. comma ( matches . body )
Original file line number Diff line number Diff line change @@ -20,6 +20,30 @@ tape("postcss-selector-not", t => {
20
20
"should really do nothing if there is no :not"
21
21
)
22
22
23
+ t . equal (
24
+ transform ( "em[attr=:not] {}" ) ,
25
+ "em[attr=:not] {}" ,
26
+ "should do nothing if an attribute selector value contains :not"
27
+ )
28
+
29
+ t . equal (
30
+ transform ( "em[attr~=:not] {}" ) ,
31
+ "em[attr~=:not] {}" ,
32
+ "should really do nothing if an attribute selector value contains :not"
33
+ )
34
+
35
+ t . equal (
36
+ transform ( "em[:not=abc] {}" ) ,
37
+ "em[:not=abc] {}" ,
38
+ "should do nothing if a selector on an attribute named :not"
39
+ )
40
+
41
+ t . equal (
42
+ transform ( ":not {}" ) ,
43
+ ":not {}" ,
44
+ "should do nothing if :not has missing parenthesis"
45
+ )
46
+
23
47
t . equal (
24
48
transform ( ":not(a, b) {}" ) ,
25
49
":not(a):not(b) {}" ,
@@ -29,7 +53,7 @@ tape("postcss-selector-not", t => {
29
53
t . equal (
30
54
transform ( "tag:not(.class, .class2) {}" ) ,
31
55
"tag:not(.class):not(.class2) {}" ,
32
- "should transform directes :not()"
56
+ "should transform into multiple :not()"
33
57
)
34
58
35
59
t . equal (
You can’t perform that action at this time.
0 commit comments