postcss-prefix-selector icon indicating copy to clipboard operation
postcss-prefix-selector copied to clipboard

Prefix css selector from third party ui-component

Open chiquan-hong opened this issue 4 years ago • 5 comments

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

chiquan-hong avatar Aug 06 '21 11:08 chiquan-hong

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.

RadValentin avatar Aug 07 '21 22:08 RadValentin

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

chiquan-hong avatar Aug 09 '21 07:08 chiquan-hong

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?

eduardoumpierre avatar Dec 14 '21 11:12 eduardoumpierre

@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.

RadValentin avatar Dec 14 '21 12:12 RadValentin

@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?

saxoncameron avatar Nov 01 '22 23:11 saxoncameron