Tailwind 4 @reference '#tailwindcss' doesn't work when style is <style lang='postcss'>
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- css, nuxt, tailwind, typescript
- Ambito
- build-system, frontend
Direzione di ricerca
Start with nuxt.config.ts and reproduce the issue in a Vue component using the shown scoped lang="postcss" style block. Compare resolution of @reference '#tailwindcss' with the package.json #importtailwindcss workaround, and verify the fix in production mode; done means nested PostCSS and @apply work without the workaround.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Versions:
"@nuxtjs/tailwindcss": "^7.0.0-beta.0",
"nuxt": "^3.17.5"
nuxt.config.ts
{
postcss: {
plugins: {
"@tailwindcss/postcss": {
optimize: false // also I need to set optimize to false in order to work on production mode
},
"postcss-nested": {},
}
}
}
When the style is set to the following (postcss), then it throws errors or does nothing
<style lang='postcss' scoped>
@reference '#tailwindcss';
.ct-base__item{
@apply flex;
&--red{
@apply text-red-500;
}
}
</style>
The workaround I found is to set the following in package.json
"imports": {
"#importtailwindcss": "./app/assets/css/tailwind.css"
}
Then in Vue file, I can use @reference '#importtailwindcss' to make it work again.
<style lang='postcss' scoped>
@reference '#importtailwindcss';
.ct-base__item{
@apply flex;
&--red{
@apply text-red-500;
}
}
</style>
Or not using PostCSS also works but I cannot use nested feature
<style lang='css' scoped>
@reference '#tailwindcss';
.ct-base__item{
@apply flex;
}
.ct-base__item--red{
@apply text-red-500;
}
</style>
Anyone else having the same issue?
also to make postcss work on production see this thread
- Lingua principale
- TypeScript
- Stelle
- 1.9k
- Fork
- 193
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nuxt-modules/tailwindcss
-
bug
Difficoltà 4/5 1-2 giorni Idoneità per principianti 58/100
nuxt-modules/tailwindcss#1047 ·
-
Version 6Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
nuxt-modules/tailwindcss#1042 ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
nuxt-modules/tailwindcss#1039 · 2 commenti ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
nuxt-modules/tailwindcss#1034 · 1 commento ·
-
post css problem i guessApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
nuxt-modules/tailwindcss#1033 · 1 commento ·
Tutte le issue di nuxt-modules/tailwindcss
Issue simili
-
bug confirmed perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
videojs/video.js#9400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue hacktoberfest
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
HelpCode-ai/anythingmcp#996 ·
I maintainer di solito rispondono entro 1 giorno
-
check:passed streams:add
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
beta technical-medium ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
walletbeat/walletbeat#1625 ·
I maintainer di solito rispondono entro 1 giorno
-
[Good First Issue]: Add unit tests for NetworkVersionInfoForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaGood First Issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
hiero-ledger/hiero-sdk-js#4489 ·
I maintainer di solito rispondono entro 1 giorno