question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v13 - PostCSS resolving changes broke tailwind used by a lib

See original GitHub issue

Current 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/nesting to 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaysoocommented, Oct 21, 2021

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.

0reactions
shervElmicommented, Feb 4, 2022

@jaysoo

Thank you for your response, It will be great.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found