Skip to content

Commit 084f23e

Browse files
committed
fix: Logic/typing error when handling @at-root rules
1 parent 6430d06 commit 084f23e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ module.exports = (opts = {}) => {
227227

228228
let nodes = child.nodes
229229
if (child.params) {
230-
nodes = new Rule({ selector: child.params, nodes })
230+
nodes = [new Rule({ selector: child.params, nodes: child.nodes })]
231231
}
232232

233233
after.after(nodes)
234-
after = nodes
234+
after = nodes[nodes.length - 1]
235235
child.remove()
236236
} else if (bubble[child.name]) {
237237
copyDeclarations = true

index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test('at-root short hand', () => {
4747
run('a { & {} @at-root b { } }', 'a {} b {}')
4848
})
4949

50-
test.skip('hoists multiple at-roots', () => {
50+
test('hoists multiple at-roots', () => {
5151
run(
5252
`a {
5353
& {}
@@ -66,7 +66,7 @@ test.skip('hoists multiple at-roots', () => {
6666
)
6767
})
6868

69-
test.skip('hoists at-root and media siblings', () => {
69+
test('hoists at-root and media siblings', () => {
7070
run(
7171
`a {
7272
& {}

0 commit comments

Comments
 (0)