-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[carbon-components]: component tokens.scss files import CSS reset and base styles #8500
Comments
You can also set |
As @tw15egan noted, I believe you will need to set Unfortunately having these files not bring in the reset would be considered a breaking change (since the emitted CSS would change) but we could totally look at having this behavior in v11 where component modules don't necessarily bring in the reset. |
Setting
So I went ahead and set
I'm not sure how to turn off the keyframes though. We could assume that the keyframe definitions are unlikely to cause many issues in "third-party" code, so let's leave it at that. However, the issue with this approach is that now we have disabled the Carbon reset and base styles globally outside the theme file as well (which also brakes styling in microservices). I tried setting
Is this because |
@vronjec thanks for the detailed response! It helps a ton when tracking this stuff down. Could you speak more to the output that you would expect from including the tokens file? is it that no CSS should be emitted and that it's used for only variables? |
Yes, the intent with the theme file is that it contains color related CSS variables only, so it can be served globally to all microservices. Any additional styles would conflict with various services: https://github.ibm.com/Bluemix/core-dev/issues/10513. So to reiterate, our issue is that we were hoping to acquire the component specific tokens for tags and notifications through the |
Awesome, thanks so much @vronjec that helps a ton 🙏 I think the reset is ultimately coming from the import to Curious what you think @tw15egan 🤔 |
@joshblack Yeah I think that may do the trick |
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
We are trying to create a global theme file (containing multiple themes) that can be used across independent microservices. Ideally, the theme file should only contain CSS variables that can be consumed by any microservice without altering their base (
h1
,p
,img
) styles.Our approach to creating such a theme file:
Unfortunately, the component imports (e.g.
carbon-components/scss/components/tags/tokens
,carbon-components/scss/components/notification/tokens
, etc) also include CSS reset and base styles.So the resulting CSS will look like this:
This causes various styling issues across the consuming microservices, and as such, we can't rely on any component
_tokens.scss
for theming purposes right now.It is related to all Carbon component that use their own tokens for styling (e.g. tag, notification, etc).
We would like to be able to include component
_tokens.scss
files without any additional styling changes.Alternatively, component tokens could be part of the theme imports, so that there is no need to import
_tokens.scss
separately at all.carbon-components
: 10.33.0carbon-components-react
: 7.33.0Related issue on Cloud PAL: https://github.ibm.com/ibmcloud/pal/issues/4430
The text was updated successfully, but these errors were encountered: