fix(css): scope the subject compound so theme-dark rules keep matching
This commit is contained in:
@@ -48,6 +48,18 @@ describe("scoping the built stylesheet", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("scopes the subject, so an ancestor outside the root still matches", () => {
|
||||
expect(one(".theme-dark .hue-chip{c:1}")).toBe(
|
||||
".theme-dark :is(.beaver-root, .beaver-root *).hue-chip { c: 1; }"
|
||||
);
|
||||
expect(one(".a > button{c:2}")).toBe(
|
||||
".a > button:is(.beaver-root, .beaver-root *) { c: 2; }"
|
||||
);
|
||||
expect(one(".a *{c:3}")).toBe(
|
||||
".a :is(.beaver-root, .beaver-root *) { c: 3; }"
|
||||
);
|
||||
});
|
||||
|
||||
it("leaves rules that already name the root alone", () => {
|
||||
const reset = ".beaver-root.beaver-root button{cursor:pointer}";
|
||||
expect(one(reset)).toBe(
|
||||
|
||||
Reference in New Issue
Block a user