Replies: 2 comments 5 replies
-
|
I ran into the same issue while setting up Tailwind with Nuxt. The TypeScript error happens because the plugin returned by import tailwindcss from "@tailwindcss/vite"
export default defineNuxtConfig({
compatibilityDate: "2025-07-15",
devtools: { enabled: true },
vite: {
plugins: [
tailwindcss() as any,
],
},
})I also hit the 404 error mentioned in step 5 of the guide. The path in the docs uses css: ['~/assets/css/main.css']After updating the path, the stylesheet loaded correctly and the 404 error disappeared. Might be worth updating the docs to reflect this |
Beta Was this translation helpful? Give feedback.
-
|
One possible approach could be exposing the filter chain so plugins can append to it instead of redefining the whole property. CSS If there were a shared extension point (for example something like That would keep the composable model while making custom filter utilities easier to extend. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Rationale
Atomic/generic classes are inherently constrained by the cascading nature of CSS when it comes to same-property composability across multiple declarations. For lack of a proper native additive syntax, tailwind navigates this limitation by relying on internally pre-defined custom properties lists to place-hold potentially "additive" values. One example would be filter utilities which include a common filter chain that translates into something like
Except, this remains a somewhat blackboxed solution that is currently not extendable through a proper API. Thus, when wanting to create custom filter utilities using either the
@utilitysyntax or the legacy js plugin API, users need to either throw that system out completely or manually redeclare an extended version of the variable list. The former leads to losing any additive capabilities, the latter is tedious, error-prone, and lacks any convention to guarantee compatibility with other third party plugins.Proposal
Add an plugin API or a custom CSS syntax that allows to conventionally stack values on composable properties across multiple utilities in a way that enables both default and custom utilities to co-extend each other.
Prefixed theme variables
One way to achieve this would be to detect and auto-extend listable properties based on theme variable names that target them. This approach moves away from explicitly defined lists and would instead derive a property's composition based on scannable theme variables.
would yield:
Major caveat is this is still somewhat obscure and works only for non-inheritable variables.
Custom additive syntax
Here a custom syntax would be used to flag which values should be composed together.
Beta Was this translation helpful? Give feedback.
All reactions