-
Notifications
You must be signed in to change notification settings - Fork 68
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
Idea: make the class name prefix 'x' a parameter #83
Comments
Yeah, I've thought about exposing import cxs from 'cxs'
cxs.prefix = '_cxs' As far as importing components that use cxs, I haven't run into issues with my own use FWIW. There should only be one |
Sounds good. Yes in our case these are components (mini apps) imported and rendered at runtime not compile. In that case |
+1 I'm using cxs for a chrome extension that augments gmail, but gmail declares several two character classnames matching x*. The PR sounds straightforward enough. Should I submit one? |
The new |
I have a few components that are built separately as different bundles. They come with their own styles and get merged into an app.
However, I am not sure cxs supports that kind of use case. Since style tags are added to the parent HTML document there are collisions.
in
src/cxs/index.js
, line 20 we have this:const className = 'x' + (rules.length).toString(36)
'x' is a hardcoded prefix. What if we allow alternative prefixes to be passed? Ideally once at initialization of the library.
That way we could define separate prefixes in different projects and when they get mashed up (at runtime for example), the written styles do not collide.
The text was updated successfully, but these errors were encountered: