Nuxt 3: Change import order/inject position #3447
nicklassandell
started this conversation in
General
Replies: 2 comments 4 replies
-
I am willing to align this option, thanks for your feedback. |
Beta Was this translation helpful? Give feedback.
4 replies
-
In nuxt I found a temporary solution, disable unocss autoimport. nuxt.config.ts css: [
'assets/styles/reset.scss',
'assets/styles/screen.scss',
'uno:preflights.css',
'assets/styles/main.scss',
'assets/styles/prose.scss',
'assets/styles/blocks.scss',
'uno.css',
'uno:default.css',
],
unocss: {
autoImport: false,
}, unocss.config.ts export default defineConfig({
outputToCssLayers: true,
}) I don't know if there is any other better way |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Tailwind has an option for injectPosition which seems to be what I'm looking for: https://tailwindcss.nuxtjs.org/getting-started/options#injectposition Is there something similar in unocss, or a better solution?
Currently we have our CSS imported in nuxt.config like this:
and of course we have the @unocss/nuxt module installed. This works, but it places our CSS at the bottom (giving it the highest selector priority). The unocss utilities should always come last so it has the highest prio. Is there a way to accomplish this?
I saw the layers config in the docs, which might be helpful, but I'm not sure how to configure a layer for our css. We're also using SCSS and i'm not sure it's possible to import? https://unocss.dev/config/layers#ordering
Beta Was this translation helpful? Give feedback.
All reactions