Tailwind 4 @reference '#tailwindcss' doesn't work when style is <style lang='postcss'>
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- css, nuxt, tailwind, typescript
- 領域
- build-system, frontend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 1.9k
- フォーク
- 192
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuxt-modules/tailwindcss のほかの issue
-
Version 6オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
nuxt-modules/tailwindcss#1042 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
nuxt-modules/tailwindcss#1039 · コメント 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
nuxt-modules/tailwindcss#1034 · コメント 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
nuxt-modules/tailwindcss#1033 · コメント 1 件 ·
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
nuxt-modules/tailwindcss#1031 · コメント 7 件 ·
nuxt-modules/tailwindcss の issue をすべて見る
似ている issue
-
area/core status/need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
google-gemini/gemini-cli#29602 ·
メンテナーはふだん 1 日以内に返信
-
area: backend enhancement priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
snapotter-hq/SnapOtter#1879 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Tencent/BrowserSkill#390 ·
メンテナーはふだん 1 日以内に返信
-
good first issue status: needs triaging type: bug version: 2.0
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
medusajs/medusa#17094 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信