|
8 | 8 |
|
9 | 9 | /* |
10 | 10 | * We import all of these here instead of in the corresponding component files |
11 | | - * so we can control the order things are imported in. In theory that's what the |
12 | | - * @layer directives are for, but Vite's usage of postcss-import didn't seem |
13 | | - * to be aware of the @tailwind directives here. I suspect it was not following |
14 | | - * the order specified in our postcss config. In any case we don't need to worry |
15 | | - * about that if we're controlling the order directly here. All of these end up |
16 | | - * inlined into a single file by postcss-import. |
| 11 | + * so we can control the order things are imported in. Tailwind v4 uses native |
| 12 | + * CSS cascade layers (@layer), and the first @layer declaration establishes |
| 13 | + * precedence order. Each @import can be assigned to a layer using layer() |
| 14 | + * syntax, ensuring predictable specificity regardless of import order. |
17 | 15 | */ |
18 | 16 |
|
| 17 | +@layer base, components, utilities; |
| 18 | + |
19 | 19 | @import 'tailwindcss'; |
20 | 20 |
|
21 | 21 | @import '@oxide/design-system/styles/tailwind.css'; |
|
24 | 24 |
|
25 | 25 | @import './fonts.css' layer(base); |
26 | 26 | @import './vars.css' layer(base); |
27 | | -@import './components/button.css'; |
28 | | -@import './components/menu-button.css'; |
29 | | -@import './components/menu-list.css'; |
30 | | -@import './components/loading-bar.css'; |
31 | | -@import './components/Tabs.css'; |
32 | | -@import './components/form.css'; |
33 | | -@import './components/login-page.css'; |
34 | | -@import './components/mini-table.css'; |
35 | | -@import './components/side-modal.css'; |
36 | | -@import './components/spinner.css'; |
37 | | -@import './components/table.css'; |
38 | | -@import './components/tooltip.css'; |
39 | | -@import './themes/selection.css'; |
| 27 | +@import './components/button.css' layer(components); |
| 28 | +@import './components/menu-button.css' layer(components); |
| 29 | +@import './components/menu-list.css' layer(components); |
| 30 | +@import './components/loading-bar.css' layer(components); |
| 31 | +@import './components/Tabs.css' layer(components); |
| 32 | +@import './components/form.css' layer(components); |
| 33 | +@import './components/login-page.css' layer(components); |
| 34 | +@import './components/mini-table.css' layer(components); |
| 35 | +@import './components/side-modal.css' layer(components); |
| 36 | +@import './components/spinner.css' layer(components); |
| 37 | +@import './components/table.css' layer(components); |
| 38 | +@import './components/tooltip.css' layer(components); |
| 39 | +@import './themes/selection.css' layer(components); |
40 | 40 |
|
41 | 41 | @import '@xterm/xterm/css/xterm.css' layer(components); |
42 | 42 | @source '../../../node_modules/@oxide/design-system/dist'; |
|
0 commit comments