tailwindlabs / discuss

A place to ask questions, get help, or share what you've built with Tailwind CSS.
MIT License
171 stars 9 forks source link

How cai I hook into result selectors #154

Open eduPHP opened 6 years ago

eduPHP commented 6 years ago

Hello Adam and everyone.

So... I am working on this project that have a component that people pastes on their website and it renders a button and some other things. To prevent conflicting, I know there is the prefix, but instead of prefixing, I want to namespace the whole resulting css.

I could somehow do it with a prefix my-namespace . , where the resulting classes would be eg. .my-namespace .text-white

The problem is with the responsive variants that turns out as .md:my-namespace .text-white instead of .my-namespace .md:text-white so I discarded the idea.

I think I could accomplish it by hooking into the resulting selectors and adding the namespace manually. Any idea in how can I do this?

adamwathan commented 6 years ago

The problem is with the responsive variants that turns out as .md:my-namespace .text-white instead of .my-namespace .md:text-white so I discarded the idea.

This is actually fixed in 0.6.0, so maybe give it a shot again.

You could always write your own PostCSS plugin to prefix all of the rules too after Tailwind is done.

eduPHP commented 6 years ago

Ohh, I was using 0.5.3 Updated and it just works perfectly!

Thanks for answering so quickly, great job with this framework, I am loving to use it!!!