I'm trying to use this plugin along with postcss-nested as a replacement for SASS, sadly, this plugin throws an error when you try to use TailwindCSS's @apply inside a mixin:
This works:
@define-mixin alert {
background: red;
}
This doesn't work:
@define-mixin alert {
@apply bg-red-500;
}
This is the error it throws:
ERROR in ./src/components/Alert/alert.css (./node_modules/css-loader/dist/cjs.js!./node_modules/@storybook/addon-postcss/node_modules/postcss-loader/dist/cjs.js??ref--9-2!./src/components/Alert/alert.css)
Module build failed (from ./node_modules/@storybook/addon-postcss/node_modules/postcss-loader/dist/cjs.js):
Error: No parent could be found
at ***/src/components/Alert/alert.css:2:3
at findParent (***/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js:218:9)
at ***/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js:228:33
at ***/node_modules/postcss/lib/container.js:151:16
at ***/node_modules/postcss/lib/container.js:74:18
at AtRule.each (***/node_modules/postcss/lib/container.js:60:16)
at AtRule.walk (***/node_modules/postcss/lib/container.js:71:17)
at ***/node_modules/postcss/lib/container.js:79:24
at Root.each (***/node_modules/postcss/lib/container.js:60:16)
at Root.walk (***/node_modules/postcss/lib/container.js:71:17)
at Root.walkAtRules (***/node_modules/postcss/lib/container.js:149:17)
at processApplyAtRules (***/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js:225:9)
at ***/node_modules/tailwindcss/lib/lib/substituteClassApplyAtRules.js:334:14
at async LazyResult.runAsync (***/node_modules/postcss/lib/lazy-result.js:358:11)
at async LazyResult.runAsync (***/node_modules/postcss/lib/lazy-result.js:358:11)
at async Object.loader (***/node_modules/@storybook/addon-postcss/node_modules/postcss-loader/dist/index.js:95:14)
I'm trying to use this plugin along with postcss-nested as a replacement for SASS, sadly, this plugin throws an error when you try to use TailwindCSS's
@apply
inside a mixin:This works:
This doesn't work:
This is the error it throws:
Has anyone had a similar problem?