-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug]: Carbon CSS has syntax errors #17824
Comments
Thanks for reporting - looks like this is part of the button mixin and related to the contextual layout tokens carbon/packages/styles/scss/components/button/_mixins.scss Lines 26 to 42 in 66c14c2
|
Thanks, I agree that's for (1). For (2) it seems related to https://github.com/carbon-design-system/ibm-products/blob/5b5e681f7c52c0950419a9081df497cb2033791d/packages/ibm-products-styles/src/components/PageHeader/_page-header.scss#L124 but should I file it separately under https://github.com/carbon-design-system/ibm-products/issues? |
None of these are technically syntax errors themselves. CSS custom properties are typeless by default and can contain anything you want. That's why (2) is occurring: sass shouldn't replace Issues can only stem from where/how you use it. For (1) I can elaborate on the original background: These custom properties are only parts of calculations which aren't intended to be used by themselves but only within other calculations. Example: calc((layout.size('height') - var(--temp-1lh)) / 2 - convert.to-rem(1px)), Given that CSS supports nested calcs ( For (2), it needs to be interpolated explicitly: |
Woops, you are right. My real issue was that this syntax was breaking JSDOM, precluding me from properly testing accessibility in a Node environment. Or at least, that's what it seemed like, but (as shown above) I had trouble reducing to a simple test case. I filed carbon-design-system/ibm-products#6575 about the issue in @carbon/ibm-products. But as you said, neither of these things are technically syntax errors. So feel free to close the ticket if you want. But adding Maybe at some point, I will come back to the Node problem, and see if adding the |
PS: Since those CSS variables are global -- or at least, they are visible to everything in the Carbon CSS rollup file -- shouldn't they have more unique names, like |
Oh you're right, I forgot that variables can be scoped. |
Package
@carbon/styles
Browser
Chrome
Package version
1.67
React version
18
Description
Carbon's CSS -- node_modules/@carbon/styles/css/styles.css and also node_modules/@carbon/ibm-products/css/index-full-carbon.css -- has syntax errors.
Reproduction/example
N/A
Steps to reproduce
Load node_modules/@carbon/styles/css/styles.css and also node_modules/@carbon/ibm-products/css/index-full-carbon.css in your IDE. For me, I loaded in Webstorm. The problems should also be detectable with
stylelint
but that prints thousands of errors.I also wrote some Node code to test loading that CSS, but it doesn't seem to mind or flag the errors. I'll leave the code here anyway for reference:
Suggested Severity
None
Application/PAL
IKC
Code of Conduct
The text was updated successfully, but these errors were encountered: