RadValentin / postcss-prefix-selector

Prefix all CSS rules with a selector
MIT License
165 stars 16 forks source link

Prefix css selector from third party ui-component #92

Open chiquan-hong opened 3 years ago

chiquan-hong commented 3 years ago

Hi Guys,

this is not an issue, it's just a general question, cause i couldn't find any information about that. In our project we are importing an third-party ui-components library. Is it possible to prefix all the css-selector from the used component library as well? Cause at the moment it seems like, its not doing that. If yes, how can i do that?

thanks for your time and best regards,

Quan

RadValentin commented 3 years ago

Hey @chiquan-hong, it depends on how you're loading the third party library. You'd need to find a way to run those styles through postcss. Can you give me more details on what library you're trying to load? Also, how are you running postcss, is it through webpack. I can try setting up a demo project to demonstrate how to prefix 3rd party styles but I need more info on how to set it up.

chiquan-hong commented 3 years ago

Hi Valentin,

thanks a lot for your time and the quick reply. To be more precise, we are using our own custom ui-components library, which is published in npm. https://www.npmjs.com/package/@axa-ch/esales-ui-components. We import it via package.json and then use the components. We are running postcss through rollup (see the screenshot).

image

image

Yeah it would be great if u could create an example setup :)

thanks for your time and best regards

Quan

eduardoumpierre commented 2 years ago

Hi @RadValentin. I'm trying to add prefixes to my own UI library's components and I have a very similar setup as @chiquan-hong's, the only difference is that I'm using the Webpack loader.

Did you manage to achieve this behavior?

RadValentin commented 2 years ago

@EduardoUmpierre Unfortunately I haven't had much time to dedicate to open source lately. I have winter vacation coming up so I may look at it but I'm not making any promises, we'll see.

saxoncameron commented 1 year ago

@eduardoumpierre Unfortunately I haven't had much time to dedicate to open source lately. I have winter vacation coming up so I may look at it but I'm not making any promises, we'll see.

I'm also in this boat with Vite, and installed UI library components. @RadValentin Any updates on this, or hints? Is it possible, or would it require a feature/fix in this package?