Skip to content

Commit 1907f2f

Browse files
authored
fix: add explicit border-border to prevent color leaking from consumer CSS (#317)
* fix: add explicit border-border to prevent color leaking from consumer CSS Components using `astw:border` (border-width only) relied on the global `* { border-color: var(--border) }` rule in `@layer base`. When consumers import Tailwind CSS after app-shell styles, Tailwind's preflight resets border-color to `var(--color-gray-200)`, causing thick gray borders. Adding explicit `astw:border-border` at the utility layer ensures the correct color regardless of CSS import order. * chore(examples): remove redundant @theme and @layer base from nextjs-app globals.css The example app does not use custom Tailwind color utilities directly; all theming is handled by app-shell's internal prefixed styles. The @theme block was also broken (wrapping rgba values in hsl()).
1 parent 6fa36a7 commit 1907f2f

24 files changed

Lines changed: 37 additions & 107 deletions
Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1 @@
11
@import "tailwindcss";
2-
@import "tw-animate-css";
3-
4-
@custom-variant dark (&:is(.dark *));
5-
6-
@theme {
7-
--color-background: hsl(var(--background));
8-
--color-foreground: hsl(var(--foreground));
9-
10-
--color-card: hsl(var(--card));
11-
--color-card-foreground: hsl(var(--card-foreground));
12-
13-
--color-popover: hsl(var(--popover));
14-
--color-popover-foreground: hsl(var(--popover-foreground));
15-
16-
--color-primary: hsl(var(--primary));
17-
--color-primary-foreground: hsl(var(--primary-foreground));
18-
19-
--color-secondary: hsl(var(--secondary));
20-
--color-secondary-foreground: hsl(var(--secondary-foreground));
21-
22-
--color-muted: hsl(var(--muted));
23-
--color-muted-foreground: hsl(var(--muted-foreground));
24-
25-
--color-accent: hsl(var(--accent));
26-
--color-accent-foreground: hsl(var(--accent-foreground));
27-
28-
--color-destructive: hsl(var(--destructive));
29-
--color-destructive-foreground: hsl(var(--destructive-foreground));
30-
31-
--color-border: var(--border);
32-
--color-input: hsl(var(--input));
33-
--color-ring: hsl(var(--ring));
34-
35-
--color-chart-1: hsl(var(--chart-1));
36-
--color-chart-2: hsl(var(--chart-2));
37-
--color-chart-3: hsl(var(--chart-3));
38-
--color-chart-4: hsl(var(--chart-4));
39-
--color-chart-5: hsl(var(--chart-5));
40-
41-
--color-sidebar: hsl(var(--sidebar-background));
42-
--color-sidebar-foreground: hsl(var(--sidebar-foreground));
43-
--color-sidebar-primary: hsl(var(--sidebar-primary));
44-
--color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
45-
--color-sidebar-accent: hsl(var(--sidebar-accent));
46-
--color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
47-
--color-sidebar-border: hsl(var(--sidebar-border));
48-
--color-sidebar-ring: hsl(var(--sidebar-ring));
49-
50-
--radius-lg: var(--radius);
51-
--radius-md: calc(var(--radius) - 2px);
52-
--radius-sm: calc(var(--radius) - 4px);
53-
}
54-
55-
/*
56-
The default border color has changed to `currentcolor` in Tailwind CSS v4,
57-
so we've added these compatibility styles to make sure everything still
58-
looks the same as it did with Tailwind CSS v3.
59-
60-
If we ever want to remove these styles, we need to add an explicit border
61-
color utility to any element that depends on these defaults.
62-
*/
63-
@layer base {
64-
*,
65-
::after,
66-
::before,
67-
::backdrop,
68-
::file-selector-button {
69-
border-color: var(--color-border, currentcolor);
70-
}
71-
}

examples/nextjs-app/src/modules/pages/data-table-demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const DataTableDemoPage = () => {
172172
<Layout>
173173
<Layout.Header title="DataTable Demo" />
174174
<Layout.Column>
175-
<p className="mb-4 text-muted-foreground">
175+
<p className="mb-4 text-gray-500">
176176
DataTable demo with sortable columns, row actions, pagination, multi-select, and temporal
177177
filters for datetime, date, and time fields.
178178
</p>

packages/core/__snapshots__/src__components__attachment__Attachment.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ exports[`Attachment > snapshots > disabled 1`] = `"<div data-slot="attachment" c
44

55
exports[`Attachment > snapshots > empty default 1`] = `"<div data-slot="attachment" class="astw:@container astw:flex astw:w-full astw:min-w-0 astw:flex-col"><input multiple="" class="astw:hidden" data-testid="attachment-upload-input" type="file"><div data-slot="attachment-content" class="astw:min-w-0"><div class="astw:flex astw:flex-wrap astw:gap-4"><button type="button" aria-label="Click to upload" data-testid="attachment-upload-tile" class="astw:flex astw:h-30 astw:w-[200px] astw:shrink-0 astw:cursor-pointer astw:flex-col astw:justify-between astw:rounded-lg astw:border-2 astw:border-dashed astw:border-border astw:bg-muted/50 astw:p-3 astw:transition-colors astw:hover:bg-muted"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud-upload astw:size-5 astw:text-muted-foreground astw:opacity-60" aria-hidden="true"><path d="M12 13v8"></path><path d="M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"></path><path d="m8 17 4-4 4 4"></path></svg><div class="astw:min-w-0 astw:self-stretch astw:text-left"><p class="astw:text-sm astw:leading-normal astw:text-foreground">Click to upload</p></div></button></div></div></div>"`;
66

7-
exports[`Attachment > snapshots > populated mixed items 1`] = `"<div data-slot="attachment" class="astw:@container astw:flex astw:w-full astw:min-w-0 astw:flex-col"><input multiple="" class="astw:hidden" data-testid="attachment-upload-input" type="file"><div data-slot="attachment-content" class="astw:min-w-0"><div class="astw:flex astw:flex-wrap astw:gap-4"><div class="astw:group astw:relative"><div class="astw:relative astw:size-30 astw:shrink-0 astw:overflow-hidden astw:rounded-lg astw:bg-muted"><img alt="shoe-red.png" class="astw:size-full astw:object-cover" src="https://example.com/shoe-red.png"></div><div class="astw:absolute astw:top-2 astw:right-2 astw:opacity-0 astw:transition-opacity astw:group-hover:opacity-100 astw:group-focus-within:opacity-100"><button type="button" tabindex="0" aria-haspopup="menu" id="base-ui-_r_3_" data-slot="menu-trigger" aria-label="Attachment options for shoe-red.png" class="astw:inline-flex astw:size-7 astw:items-center astw:justify-center astw:rounded-md astw:border astw:bg-background/90 astw:text-foreground astw:shadow-xs astw:hover:bg-accent" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis astw:size-4" aria-hidden="true"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg></button></div></div><div class="astw:group astw:relative"><div class="astw:relative astw:size-30 astw:shrink-0 astw:overflow-hidden astw:rounded-lg astw:border astw:border-border astw:flex astw:flex-col astw:justify-between astw:bg-card astw:p-3"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file astw:size-5 astw:text-muted-foreground astw:opacity-60" aria-hidden="true" data-testid="attachment-file-icon"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"></path><path d="M14 2v5a1 1 0 0 0 1 1h5"></path></svg><p class="astw:flex astw:min-w-0 astw:items-end astw:gap-0.5 astw:text-xs astw:leading-normal astw:text-foreground"><span class="astw:min-w-0 astw:flex-1 astw:line-clamp-2 astw:break-all">Aug-Sep 2025_1234-12</span><span class="astw:shrink-0">.pdf</span></p></div><div class="astw:absolute astw:top-2 astw:right-2 astw:opacity-0 astw:transition-opacity astw:group-hover:opacity-100 astw:group-focus-within:opacity-100"><button type="button" tabindex="0" aria-haspopup="menu" id="base-ui-_r_8_" data-slot="menu-trigger" aria-label="Attachment options for Aug-Sep 2025_1234-12.pdf" class="astw:inline-flex astw:size-7 astw:items-center astw:justify-center astw:rounded-md astw:border astw:bg-background/90 astw:text-foreground astw:shadow-xs astw:hover:bg-accent" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis astw:size-4" aria-hidden="true"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg></button></div></div><button type="button" aria-label="Click to upload" data-testid="attachment-upload-tile" class="astw:flex astw:h-30 astw:w-[200px] astw:shrink-0 astw:cursor-pointer astw:flex-col astw:justify-between astw:rounded-lg astw:border-2 astw:border-dashed astw:border-border astw:bg-muted/50 astw:p-3 astw:transition-colors astw:hover:bg-muted"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud-upload astw:size-5 astw:text-muted-foreground astw:opacity-60" aria-hidden="true"><path d="M12 13v8"></path><path d="M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"></path><path d="m8 17 4-4 4 4"></path></svg><div class="astw:min-w-0 astw:self-stretch astw:text-left"><p class="astw:text-sm astw:leading-normal astw:text-foreground">Click to upload</p></div></button></div></div></div>"`;
7+
exports[`Attachment > snapshots > populated mixed items 1`] = `"<div data-slot="attachment" class="astw:@container astw:flex astw:w-full astw:min-w-0 astw:flex-col"><input multiple="" class="astw:hidden" data-testid="attachment-upload-input" type="file"><div data-slot="attachment-content" class="astw:min-w-0"><div class="astw:flex astw:flex-wrap astw:gap-4"><div class="astw:group astw:relative"><div class="astw:relative astw:size-30 astw:shrink-0 astw:overflow-hidden astw:rounded-lg astw:bg-muted"><img alt="shoe-red.png" class="astw:size-full astw:object-cover" src="https://example.com/shoe-red.png"></div><div class="astw:absolute astw:top-2 astw:right-2 astw:opacity-0 astw:transition-opacity astw:group-hover:opacity-100 astw:group-focus-within:opacity-100"><button type="button" tabindex="0" aria-haspopup="menu" id="base-ui-_r_3_" data-slot="menu-trigger" aria-label="Attachment options for shoe-red.png" class="astw:inline-flex astw:size-7 astw:items-center astw:justify-center astw:rounded-md astw:border astw:border-border astw:bg-background/90 astw:text-foreground astw:shadow-xs astw:hover:bg-accent" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis astw:size-4" aria-hidden="true"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg></button></div></div><div class="astw:group astw:relative"><div class="astw:relative astw:size-30 astw:shrink-0 astw:overflow-hidden astw:rounded-lg astw:border astw:border-border astw:flex astw:flex-col astw:justify-between astw:bg-card astw:p-3"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file astw:size-5 astw:text-muted-foreground astw:opacity-60" aria-hidden="true" data-testid="attachment-file-icon"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"></path><path d="M14 2v5a1 1 0 0 0 1 1h5"></path></svg><p class="astw:flex astw:min-w-0 astw:items-end astw:gap-0.5 astw:text-xs astw:leading-normal astw:text-foreground"><span class="astw:min-w-0 astw:flex-1 astw:line-clamp-2 astw:break-all">Aug-Sep 2025_1234-12</span><span class="astw:shrink-0">.pdf</span></p></div><div class="astw:absolute astw:top-2 astw:right-2 astw:opacity-0 astw:transition-opacity astw:group-hover:opacity-100 astw:group-focus-within:opacity-100"><button type="button" tabindex="0" aria-haspopup="menu" id="base-ui-_r_8_" data-slot="menu-trigger" aria-label="Attachment options for Aug-Sep 2025_1234-12.pdf" class="astw:inline-flex astw:size-7 astw:items-center astw:justify-center astw:rounded-md astw:border astw:border-border astw:bg-background/90 astw:text-foreground astw:shadow-xs astw:hover:bg-accent" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis astw:size-4" aria-hidden="true"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg></button></div></div><button type="button" aria-label="Click to upload" data-testid="attachment-upload-tile" class="astw:flex astw:h-30 astw:w-[200px] astw:shrink-0 astw:cursor-pointer astw:flex-col astw:justify-between astw:rounded-lg astw:border-2 astw:border-dashed astw:border-border astw:bg-muted/50 astw:p-3 astw:transition-colors astw:hover:bg-muted"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud-upload astw:size-5 astw:text-muted-foreground astw:opacity-60" aria-hidden="true"><path d="M12 13v8"></path><path d="M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"></path><path d="m8 17 4-4 4 4"></path></svg><div class="astw:min-w-0 astw:self-stretch astw:text-left"><p class="astw:text-sm astw:leading-normal astw:text-foreground">Click to upload</p></div></button></div></div></div>"`;

0 commit comments

Comments
 (0)