Skip to content

Conversation

rezrah
Copy link
Collaborator

@rezrah rezrah commented Jun 5, 2025

Summary

Resolves https://github.com/github/primer/issues/5302

Bumps up the CSS specificity of fill on custom leading icons in both PricingOptions.FeatureListItem and UnorderedList.Item. Does so by applying the fill through style, assuming it's not undefined.

Note: This issue occurs specifically in dotcom, where the .octicon CSS styles for fill overrides the HTML fill attribute.

Verified the Canary in dotcom Storybook, now works as expected 👇

Screenshot 2025-06-05 at 13 00 48

This update also fixes the ✔️ and ❌ icons, which previously weren't showing the correct colors for the same reason (screenshots below)

🔗 Preview link from Primer Brand Storybook

List of notable changes:

  • Added fill value as an inline style, so that dynamic values can continue to be passed through. Only applies if defined.

Steps to test:

  1. Check the screenshot at the top, which is the canary release running on dotcom storybook
  2. Go to this Storybook story and verify that the custom fill is applied as an inline style rule

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Please try to provide before and after screenshots or videos

Before After

Screenshot 2025-06-05 at 13 01 38

Screenshot 2025-06-05 at 13 01 48

Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 9fe22ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@primer/react-brand Patch
@primer/brand-docs Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jun 5, 2025

🟢 No design token changes found

@rezrah rezrah temporarily deployed to github-pages June 5, 2025 11:34 — with GitHub Actions Inactive
Copy link
Contributor

github-actions bot commented Jun 5, 2025

🟢 No visual differences found

Our visual comparison tests did not find any differences in the UI.

@rezrah rezrah changed the title Increase specificity of custom fill styles in PricingOptions.FeatureListItem and UnorderedList.Item Increase specificity of custom fill in PricingOptions Jun 5, 2025
@rezrah rezrah marked this pull request as ready for review June 5, 2025 12:09
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 12:09
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

Bumps CSS specificity for custom icon fills by applying the fill value as an inline style, ensuring it overrides conflicting rules.

  • Adds style.fill to ListItem leading visuals when leadingVisualFill is defined
  • Updates the changeset to describe the specificity increase

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/list/ListItem/ListItem.tsx Inline style.fill added to iconProps for greater specificity
.changeset/blue-bees-battle.md Change description updated to reflect specificity bump
Comments suppressed due to low confidence (2)

.changeset/blue-bees-battle.md:2

  • The changeset header references @primer/react-brand but the updated code is in @primer/react. Update the package name to ensure the patch is applied correctly.
'@primer/react-brand': patch

packages/react/src/list/ListItem/ListItem.tsx:45

  • There are no tests verifying that the inline style.fill is applied correctly. Add or update unit tests to cover the new behavior when leadingVisualFill is provided.
const iconProps = {fill: leadingVisualFill, 'aria-label': leadingVisualAriaLabel, style: {fill: leadingVisualFill}}

@rezrah rezrah temporarily deployed to github-pages June 5, 2025 12:15 — with GitHub Actions Inactive
Copy link
Contributor

@joshfarrant joshfarrant left a comment

Choose a reason for hiding this comment

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

👍

@rezrah rezrah merged commit 8a1bb23 into main Jun 5, 2025
17 checks passed
@rezrah rezrah deleted the rezrah/pricing-option-icon-fix branch June 5, 2025 13:55
@primer-css primer-css mentioned this pull request Jun 5, 2025
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.

3 participants