Is importing specific component styles still supported? #13968
-
The usage guidance describes importing specific component styles as the preferred method for importing styles: @use "@carbon/react/scss/components/button"; @janhassel and I discovered cases where not all component dependencies are imported with their module. For example, We assume these are slipping under the radar because currently only all the Carbon styles are imported for visual testing. So... is this method still supported? If so, how might we catch these issues sooner? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I'm seeing part of the issue is because we are referencing The https://stackblitz.com/edit/github-c7km3p-4rbsey?file=src%2Findex.scss,src%2FApp.jsx,src%2Findex.jsx |
Beta Was this translation helpful? Give feedback.
-
@tw15egan, @janhassel put up additional PR up here: #13984 @SimonFinney, yes importing specific component styles is supported. I've updated it to no longer stay "preferred" though. The e2e test file you referenced there is actually unused and should've been removed a while ago but was missed. The e2e setup used right now runs against the storybook. To test component styles in isolation we'd need to reconsider this approach. The implications of this would include:
|
Beta Was this translation helpful? Give feedback.
@tw15egan, @janhassel put up additional PR up here: #13984
@SimonFinney, yes importing specific component styles is supported. I've updated it to no longer stay "preferred" though. The e2e test file you referenced there is actually unused and should've been removed a while ago but was missed. The e2e setup used right now runs against the storybook. To test component styles in isolation we'd need to reconsider this approach. The implications of this would include: