Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix css selector from third party ui-component #92

Open
chiquan-hong opened this issue Aug 6, 2021 · 5 comments
Open

Prefix css selector from third party ui-component #92

chiquan-hong opened this issue Aug 6, 2021 · 5 comments

Comments

@chiquan-hong
Copy link

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
Copy link
Owner

RadValentin commented Aug 7, 2021

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
Copy link
Author

chiquan-hong commented Aug 9, 2021

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
Copy link

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
Copy link
Owner

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants