Skip to content

fix: Ensure icon color for SystemIconCircle can be overwritten #3322

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

Merged
merged 3 commits into from
Jun 9, 2025

Conversation

RayRedGoose
Copy link
Contributor

@RayRedGoose RayRedGoose commented Jun 4, 2025

Summary

Fixes: #3321

Ensure Icon color is the same for all background colors.

Release Category

Components

Release Note

Property color has been added to SystemIconCircle to fix and allow the overwriting of icon color if it's not handle automatically. systemIconCircleStencil is now exported.


Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

Thank You Gif (optional)

@RayRedGoose RayRedGoose marked this pull request as ready for review June 4, 2025 18:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a color prop to the SystemIconCircle component for manual icon color overrides and exports the systemIconCircleStencil. It also updates the story examples to demonstrate using the new prop.

  • Exports systemIconCircleStencil and adds color prop with fallback logic to SystemIconCircle
  • Updates Icons.stories.tsx to import the stencil and show color usage

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
modules/react/icon/stories/Icons.stories.tsx Imported systemIconCircleStencil, added color usage in story, removed legacy import of base
modules/react/icon/lib/SystemIconCircle.tsx Exported stencil, defined color prop, updated style vars and defaults
Comments suppressed due to low confidence (4)

modules/react/icon/lib/SystemIconCircle.tsx:31

  • New color prop behavior isn’t covered by existing unit tests. Consider adding tests to verify the override and fallback logic for color.
  color?: string;

modules/react/icon/lib/SystemIconCircle.tsx:55

  • The code references base.soap200 but base is not imported; also, the imported colors export provides colors.soap200. Consider using cssVar(background, colors.soap200) or explicitly importing base from the correct tokens package.
background: cssVar(background, base.soap200),

modules/react/icon/lib/SystemIconCircle.tsx:55

  • cssVar and system are used in this file but neither is imported. Please add import {cssVar} from '@workday/canvas-kit-styling' and import {system} from '@workday/canvas-tokens-web' (or the appropriate modules) so these references resolve.
background: cssVar(background, base.soap200),

modules/react/icon/stories/Icons.stories.tsx:19

  • [nitpick] The createStyles import is unused in this file. Removing it will clean up unused code.
import {createStyles, cssVar} from '@workday/canvas-kit-styling';

Copy link

cypress bot commented Jun 4, 2025

Workday/canvas-kit    Run #8909

Run Properties:  status check passed Passed #8909  •  git commit ca83bc3069 ℹ️: Merge 7189a7d8d25e9405a8ccf50d0031f929526f6c97 into e4802fff38e7db94b7ab21fc7fbd...
Project Workday/canvas-kit
Branch Review fix-system-icon-circle
Run status status check passed Passed #8909
Run duration 02m 49s
Commit git commit ca83bc3069 ℹ️: Merge 7189a7d8d25e9405a8ccf50d0031f929526f6c97 into e4802fff38e7db94b7ab21fc7fbd...
Committer Raisa Primerova
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 936
View all changes introduced in this branch ↗︎
UI Coverage  21.27%
  Untested elements 1530  
  Tested elements 411  
Accessibility  99.28%
  Failed rules  6 critical   5 serious   0 moderate   2 minor
  Failed elements 98  

@RayRedGoose RayRedGoose self-assigned this Jun 4, 2025
@RayRedGoose RayRedGoose added the ready for review Code is ready for review label Jun 4, 2025
@mannycarrera4
Copy link
Contributor

This feels like a feature cause you're adding stuff, but it's a fix into support yeah?

* If not specified, it will be calculated based on the background color.
* @default rgba(0,0,0,0.65)
*/
color?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

ah maybe you're just matching with SystemIcon does.

vars: {
containerSize: '',
backgroundColor: '',
iconColor: '',
background: '',
Copy link
Contributor

Choose a reason for hiding this comment

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

i suppose not a breaking change because it wasn't previously exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, there is nothing used externally before 👌

@RayRedGoose
Copy link
Contributor Author

@mannycarrera4 I feel like it's tricky :D i'm adding some stuff, but the purpose is to fix issue with icon colors, that is not work anymore with vars 🤔

@mannycarrera4
Copy link
Contributor

Maybe we make this off of master instead?

@RayRedGoose
Copy link
Contributor Author

Yeah let's do

@RayRedGoose RayRedGoose changed the base branch from support to master June 6, 2025 14:38
@mannycarrera4 mannycarrera4 changed the title fix: Fix icon color for SystemIconCircle fix: Ensure icon color for SystemIconCircle can be overwritten Jun 9, 2025
@mannycarrera4 mannycarrera4 added automerge and removed ready for review Code is ready for review labels Jun 9, 2025
@alanbsmith alanbsmith merged commit 47396a8 into Workday:master Jun 9, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon Color is not selected correctly if background set as a CSS variable
3 participants