Description
Hi, is there a way my lwc css can @import a Static Resource css?
I have a lwc that is both available in the sf community and sf record page. I have build all my community custom css and saved all in the Static Resource. When I drop this lwc into the sf record page, I wish to apply the custom css to this component only. I have tried to use loadStyle in the js, but it's apply the css to the global level. Is there a way this lwc css can ref to the custom css in the Static Resource?
I tried:
@import url('/resource/xxx/main.css')
or
@import url('@salesforce/resource/xxx/main.css');
Getting invalid import statement, unable to find imported module.
Is there anywhere we can requested this feature? This should be standard css rules.
https://developer.mozilla.org/en-US/docs/Web/CSS/@import
Activity