Skip to content
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

fix(useravatar): variable change #6856

Merged
merged 6 commits into from
Feb 11, 2025

Conversation

anamikaanu96
Copy link
Contributor

Closes #6854

I noticed this while working on user avatar web components.
The root cause of issue is that the storybook theme variable is changed from storybook-carbon-theme to data-carbon-theme.

With wrapper it is working fine.

What did you change? packages/ibm-products-styles/src/components/UserAvatar/_user-avatar.scss

How did you test and verify your work? storybook

@anamikaanu96 anamikaanu96 requested a review from a team as a code owner February 6, 2025 10:56
@anamikaanu96 anamikaanu96 requested review from davidmenendez and sangeethababu9223 and removed request for a team February 6, 2025 10:56
Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 3fca99b
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/67a5b808ab28f00008ecb3b6
😎 Deploy Preview https://deploy-preview-6856--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for ibm-products-web-components ready!

Name Link
🔨 Latest commit 3fca99b
🔍 Latest deploy log https://app.netlify.com/sites/ibm-products-web-components/deploys/67a5b808bee7e00008947cfc
😎 Deploy Preview https://deploy-preview-6856--ibm-products-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.31%. Comparing base (44a206d) to head (3fca99b).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6856   +/-   ##
=======================================
  Coverage   81.31%   81.31%           
=======================================
  Files         397      399    +2     
  Lines       12959    12965    +6     
  Branches     4261     4262    +1     
=======================================
+ Hits        10537    10543    +6     
  Misses       2422     2422           
Components Coverage Δ
ibm-products ∅ <ø> (∅)
ibm-products-web-components ∅ <ø> (∅)

davidmenendez
davidmenendez previously approved these changes Feb 6, 2025
@@ -83,8 +83,8 @@ $sizes: (
@mixin setDarkBg($order, $color) {
.#{$carbon-prefix}--g90 .#{$block-class}--#{$order},
.#{$carbon-prefix}--g100 .#{$block-class}--#{$order},
[storybook-carbon-theme='g90'] .#{$block-class}--#{$order},
[storybook-carbon-theme='g100'] .#{$block-class}--#{$order} {
[data-carbon-theme='g90'] .#{$block-class}--#{$order},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These styles will be applied to both versions of the UserAvatar component (react and web component). We also should update our web component storybook to use the data-carbon-theme as the attribute controlling the theming.

The two files to update for that are
packages/ibm-products-web-components/.storybook/preview.ts
and
packages/ibm-products-web-components/.storybook/container.scss

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't think of this. good call!

Copy link
Contributor Author

@anamikaanu96 anamikaanu96 Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @matthewgallo , @davidmenendez Thanks for reviewing! I noticed that some other files are also using storybook-carbon-theme, so I updated those files too.

config/storybook-addon-carbon-theme/README.md
config/storybook-addon-carbon-theme/src/decorators/withCarbonTheme.js
packages/core/.storybook/index.scss -> only comment change

@anamikaanu96 anamikaanu96 added this pull request to the merge queue Feb 11, 2025
Merged via the queue into carbon-design-system:main with commit 2e6fc2b Feb 11, 2025
32 checks passed
@anamikaanu96 anamikaanu96 deleted the userAvatarBG branch February 11, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Background color of UserAvatar is not dynamically changing based on theme
3 participants