Skip to content

Commit f655aee

Browse files
committed
add failing test for the apply of group-hover in a nested structure
1 parent de2e71b commit f655aee

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

__tests__/applyComplexClasses.test.js

+43
Original file line numberDiff line numberDiff line change
@@ -1094,3 +1094,46 @@ test('you can deeply apply classes in a custom nested @atrule', () => {
10941094
expect(result.warnings().length).toBe(0)
10951095
})
10961096
})
1097+
1098+
test('you can apply complex utilities deeply nested', () => {
1099+
const input = `
1100+
.foo {
1101+
.bar {
1102+
.baz {
1103+
@apply group-hover:opacity-50 hover:font-bold;
1104+
}
1105+
}
1106+
}
1107+
1108+
.group:hover .group-hover\\:opacity-50 {
1109+
opacity: .5;
1110+
}
1111+
`
1112+
1113+
const expected = `
1114+
.group\:hover .foo {
1115+
.bar {
1116+
.baz {
1117+
opacity: .5;
1118+
}
1119+
}
1120+
}
1121+
1122+
.foo {
1123+
.bar {
1124+
.baz:hover {
1125+
font-weight: 700;
1126+
}
1127+
}
1128+
}
1129+
1130+
.group:hover .group-hover\\:opacity-50 {
1131+
opacity: .5;
1132+
}
1133+
`
1134+
1135+
return run(input).then(result => {
1136+
expect(result.css).toMatchCss(expected)
1137+
expect(result.warnings().length).toBe(0)
1138+
})
1139+
})

0 commit comments

Comments
 (0)