release: WRNexusJS 0.2.35
This commit is contained in:
@@ -646,3 +646,46 @@ component CookieToggle {
|
||||
|
||||
expect(binding[1]).toBe("base {personalizationCookies ? 'enabled' : 'disabled'}");
|
||||
});
|
||||
test("parses class directives containing Tailwind arbitrary values", () => {
|
||||
const ast = parse(`
|
||||
component PageHeader {
|
||||
state centered = false
|
||||
|
||||
view {
|
||||
<div
|
||||
class="py-12"
|
||||
class:lg:grid-cols-[minmax(0,1fr)_auto]="!centered"
|
||||
class:dark:bg-white/10="centered"
|
||||
class:w-[calc(100%-2rem)]="centered"
|
||||
>
|
||||
Header
|
||||
</div>
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
expect(ast).toBeDefined();
|
||||
});
|
||||
test("compiles Tailwind arbitrary values in class directives", () => {
|
||||
const output = generate(
|
||||
parse(`
|
||||
component PageHeader {
|
||||
state centered = false
|
||||
|
||||
view {
|
||||
<div
|
||||
class="py-12"
|
||||
class:lg:grid-cols-[minmax(0,1fr)_auto]="!centered"
|
||||
class:dark:bg-white/10="centered"
|
||||
>
|
||||
Header
|
||||
</div>
|
||||
}
|
||||
}
|
||||
`),
|
||||
);
|
||||
|
||||
expect(output).toContain("lg:grid-cols-[minmax(0,1fr)_auto]");
|
||||
|
||||
expect(output).toContain("dark:bg-white/10");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user