Skip to content

[Bug] react-brand-icons: Filled and Regular icon color not swapping in high contrast mode #946

@natle01

Description

@natle01

Package

Other...

Package version

2.0.183

Current Behavior

When changing the color of a Regular or Filled icon from the brand icons package, in high contrast mode the color remains and isn't swapping to high contrast system color.

Image

Expected Behavior

  1. All "Regular" and "Filled" icons should have forced-color-adjust: auto styling on the SVG element so in high contrast mode any colors applied are swapped out for high contrast system colors.
    This is what "@fluentui/react-icons" (@2.0.306) package does for their icons to support high contrast mode.
  2. "Color" icons should remain without it as product logo colors should never be altered.
Image

Example of react-icons working as expected:
Image

Reproduction

import { Sharepoint16Filled, Sharepoint16Regular } from '@fluentui/react-brand-icons';
const Render = () => (
  <>
    <Sharepoint16Filled style={{ color: 'red' }}/>
    <Sharepoint16Regular style={{ color: 'red' }}/>
  </>
);

Steps to reproduce

  1. Import a "Filled" or "Regular" icon (not a "Color" icon) from the @fluentui/react-brand-icons package.
  2. Apply any color to the SVG.
  3. Swap to Windows high contrast mode (alt + shift + print screen).

Suggested severity

Medium - Has workaround

Products/sites affected

Anywhere a "Filled" or "Regular" product icon is used

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions