Skip to content

Commit 57c2bb4

Browse files
committed
Merge pull request #6 from jonathanKingston/pseudo-matches-fix
Fixed pseudo selectors with multiple matches in a selector
2 parents 0e01475 + bd2ca64 commit 57c2bb4

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.0.1 - 2015-10-26
2+
- Fixed: pseudo selectors with multiple matches in a selector
3+
14
# 2.0.0 - 2015-08-25
25

36
- Removed: compatibility with postcss v4.x

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-selector-matches",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "PostCSS plugin to transform :matches() W3C CSS pseudo class to more compatible CSS selectors",
55
"keywords": [
66
"postcss",

src/replaceRuleSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function explodeSelector(selector, options) {
3939
newParts = []
4040
postSelectors.forEach(postS => {
4141
bodySelectors.forEach(s => {
42-
newParts.push(pre + s + postS)
42+
newParts.push(preWhitespace + pre + s + postS)
4343
})
4444
})
4545
}

test/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ tape("postcss-selector-matches", t => {
5656
"should transform mutltiples :matches() with stuff after"
5757
)
5858

59+
t.equal(
60+
transform(":matches(tag) :matches(tag2, tag3):hover {}"),
61+
"tag tag2:hover, tag tag3:hover {}",
62+
"should transform mutltiples :matches() with pseudo after"
63+
)
64+
5965
t.equal(
6066
transform("tag :matches(tag2 :matches(tag4, tag5), tag3) {}"),
6167
"tag tag2 tag4, tag tag2 tag5, tag tag3 {}",

0 commit comments

Comments
 (0)