Tailwind Media queries ignored when coming from Angular library files

Discussão em 'Angular' iniciado por Antoine BRAESCH, Abril 24, 2025.

  1. I just developed an Angular library to factorize some frontend code i'll have in several projets and i used tailwind + PrimeNg to style the app. The media queries styles are not working properly when used in a project

    I had to add my package to the tailwind source with @source "../node_modules/@my-package/";

    and to add the css file from my lib to my styles.css. It finally is working almost good, just my media queries are not applied, even tho they are understanded by Tailwind, because they are applied but overriden by the default style outside of my media query.

    For example i have an element with the following classes : md:hidden flex

    which should display it on mobile screen, but hide it on larger screen, but the element is alaways here. When i inspect the two classes are there, but the hidden is overriden by the flex. When i test the code inside of my library, it works fine, it just don't when used in a real project. Lemme know if you need aditionnal informations

    Continue reading...

Compartilhe esta Página