mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	enable tailwind nesting (#29746)
Currently, if you implement native CSS nesting within a Vue component a warning will appear in the terminal. It states `Nested CSS was detected, but CSS nesting has not been configured correctly. Please enable a CSS nesting plugin *before* Tailwind in your configuration.` To fix this error we need to enable the built-in [tailwinds nesting config](https://tailwindcss.com/docs/using-with-preprocessors#nesting). Example code to trigger the warning within a vue component: ```CSS <style> .example { &:hover, &:focus-visible { color: var(--color-text); } & svg { margin-right: 0.78rem; } } </style> ``` --------- Co-authored-by: rafh <rafaelheard@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		| @@ -13,6 +13,8 @@ import {readFileSync} from 'node:fs'; | ||||
| import {env} from 'node:process'; | ||||
| import tailwindcss from 'tailwindcss'; | ||||
| import tailwindConfig from './tailwind.config.js'; | ||||
| import tailwindcssNesting from 'tailwindcss/nesting/index.js'; | ||||
| import postcssNesting from 'postcss-nesting'; | ||||
|  | ||||
| const {EsbuildPlugin} = EsBuildLoader; | ||||
| const {SourceMapDevToolPlugin, DefinePlugin} = webpack; | ||||
| @@ -145,6 +147,7 @@ export default { | ||||
|               sourceMap: sourceMaps === 'true', | ||||
|               url: {filter: filterCssImport}, | ||||
|               import: {filter: filterCssImport}, | ||||
|               importLoaders: 1, | ||||
|             }, | ||||
|           }, | ||||
|           { | ||||
| @@ -152,7 +155,10 @@ export default { | ||||
|             options: { | ||||
|               postcssOptions: { | ||||
|                 map: false, // https://github.com/postcss/postcss/issues/1914 | ||||
|                 plugins: [tailwindcss(tailwindConfig)], | ||||
|                 plugins: [ | ||||
|                   tailwindcssNesting(postcssNesting({edition: '2024-02'})), | ||||
|                   tailwindcss(tailwindConfig), | ||||
|                 ], | ||||
|               }, | ||||
|             }, | ||||
|           } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user