How to deduplication @tailwindbase indication in a monorepo environment #14156
Replies: 2 comments
-
Hello, Centralize Tailwind Config: Create a shared tailwind.config.js in the root: Define Layers in Shared Styles @layer base { /* Custom base styles / } @layer base { /* Custom base styles for accounts / } Best regards, |
Beta Was this translation helpful? Give feedback.
-
[self solve] I found a similar problem in stackoverflow and solved it stackoverflow-post I solved it by adding 'postcss-import' plug-in to postcss.config.ts module.exports = {
plugins: {
'postcss-import': {}, // add
tailwindcss: {},
autoprefixer: {},
},
}; |
Beta Was this translation helpful? Give feedback.
-
Currently, monorepo is being used in the tuborepo environment.
A brief description of the project structure is the apps/accounts environment and the packages/sds (ui) environment.
Both sds and accounts style using tailwind.
Problem
Q1.
Currently, sds has the following styles and accounts are in the same environment.
Looking at the above structure, the styles in sds are used repeatedly in accounts, so @tailwind [base|components|utilites] is duplicated and overlaid with the same style.
So what I want is to know how to remove overlapping styles in these cases
Q2.
Additionally, the way I solved it was duplicated by removing the @tailwind [base|components] directive to accounts.
However, if an instruction such as '@LayerBase' is used in accounts, an error such as '@LayerBase' is used but no matching '@tailwindbase' directive is present.' It seems that the '@tailwindbase' instruction must be used to use the '@LayerBase' instruction.
How can we solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions