v13 - PostCSS resolving changes broke tailwind used by a lib
See original GitHub issueCurrent Behavior
- I have an app and a UI lib in my project.
- The UI lib has its own postcss config together with a tailwind one.
- The app consumes this UI library
- Until now, when building the app, the library’s postcss config was used and everything worked as expected
- in v13, I am required to update my app’s postcss config to include the settings I have in the UI lib
It is expected that a library will hold all its configurations and assets and they will be built with them when consumed by different apps.
Worked as expected in v12.10
Steps to Reproduce
- Create a workspace with v13 with a React app
- Add a lib with Tailwind setup (tailwind+postcss)
- Add
tailwindcss/nestingto the library’s PostCSS config - Add a component to the library with a CSS file that has nesting, e.g.:
.button {
&.status-danger {
@apply text-red-500;
}
}
- Consume the component in your app - color is not applied
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Upgrade Guide - Tailwind CSS
We don't take breaking changes lightly and have worked hard to make sure the upgrade path is as simple as possible. For most...
Read more >Error: PostCSS plugin tailwindcss requires PostCSS 8
To resolve this error, uninstall Tailwind and re-install using the compatibility build instead: npm uninstall tailwindcss postcss ...
Read more >Comparing Tailwind CSS to Bootstrap: Is it time to ditch UI kits?
In this guide, we'll explore the differences between Tailwind CSS and Bootstrap, review some examples to demonstrate the advantages of using a ...
Read more >Setup Next.js to use Tailwind with Nx | by Juri Strumpflohner
Install and configure Tailwind in an Nx workspace. The first step is to install the necessary npm packages. yarn add tailwindcss@latest postcss@ ...
Read more >TailwindCSS: Adds complexity, does nothing.
Now you have to go through each component and manually change ... Tailwind prefers to use prefixed class names instead of media queries....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We have updated the logic such that the app’s tailwind config is picked up even when the libs don’t have their own config. It was done to address https://github.com/nrwl/nx/issues/7040
We can probably make this logic support picking up the lib’s config, and falling back to app if nothing is detected.
@jaysoo
Thank you for your response, It will be great.