Tailwind 4 @reference '#tailwindcss' doesn't work when style is <style lang='postcss'>
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- css, nuxt, tailwind, typescript
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 1.9k
- Fork
- 193
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nuxt-modules/tailwindcss
-
bug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 58/100
nuxt-modules/tailwindcss#1047 · 1 reaction ·
-
Version 6Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
nuxt-modules/tailwindcss#1042 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
nuxt-modules/tailwindcss#1039 · 2 bình luận ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
nuxt-modules/tailwindcss#1034 · 1 bình luận ·
-
post css problem i guessĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
nuxt-modules/tailwindcss#1033 · 1 bình luận ·
Tất cả issue của nuxt-modules/tailwindcss
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
auth: agent-bearer --manager-call is told to use the MCP instance argument on an ambiguous managerĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Lyric and ApostrophesĐang mởbug module: playback
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chthollyphile/folia-major#739 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agilepathway/label-checker#773 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày