Skip to content

Commit

Permalink
Allow outer whitespce in css-not-sel-list
Browse files Browse the repository at this point in the history
Fixes #168
  • Loading branch information
edg2s authored and clshortfuse committed Oct 4, 2023
1 parent 75ed0d7 commit 0a1ae0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/features/css-not-sel-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ import { checkSelector } from '../../utils/util.js';
* @type {import('../features').Feature}
*/
export default checkSelector(
(selector) => selector.includes(':not(') && !/:not\(.?#?-?[\w[\]-]+\)/.test(selector),
(selector) => selector.includes(':not(') && !/:not\(\s*.?#?-?[\w[\]-]+\s*\)/.test(selector),
);
9 changes: 8 additions & 1 deletion test/cases/features/css-not-sel-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See: https://caniuse.com/css-not-sel-list

/*
expect:
css-not-sel-list: 4
css-not-sel-list: 5
*/

.test:not(a, .b, [c]) {
Expand All @@ -27,6 +27,10 @@ css-not-sel-list: 4
color: red;
}

.test:not( a, b ) {
color: red;
}

.test:not(a.b) {
color: red;
}
Expand All @@ -38,3 +42,6 @@ css-not-sel-list: 4
.test:not(.b):not([c]) {
color: red;
}
.test:not( a ) {
color :red;
}

0 comments on commit 0a1ae0c

Please sign in to comment.