You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
constfs=require("node:fs");constjsdom=require("jsdom");const{JSDOM}=jsdom;constcarbonCss=fs.readFileSync('node_modules/@carbon/ibm-products/css/index-full-carbon.css','utf8');// JSDOM can't [yet] handle CSS with @charset or with has().// has() is supposed to be working though, see https://stackoverflow.com/questions/71490461/jsdom-and-pseudoclass-has.constadjustedCarbonCSS=carbonCss.replace(/(@charset.*?\n)|(:has\(.*?\))/g,"");const{ window }=newJSDOM(`<html> <head> <style>${adjustedCarbonCSS}</style> </head> <body class="cds--list-box__menu"> <p>Hello world</p> </body></html>`);console.log(window.getComputedStyle(window.document.body).display);
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: