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

Fluent: make icons customizable #5413

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

OEvgeny
Copy link
Collaborator

@OEvgeny OEvgeny commented Jan 23, 2025

Fluent: make icons customizable

Changelog Entry

Changed

  • Enabled icon customization in Fluent theme through CSS variables, in PR #5413, by @OEvgeny

Description

This PR allows customization of icons in the Fluent theme by transitioning from hardcoded SVG components to mask-based images. This change enables developers to:

Design

The implementation uses the MonochromeImageMasker component which leverages CSS masks instead of inline SVGs. Some additional tweaks were made:

  1. Added a new CSS variable --monochrome-image-masker__mask-image that falls back to the default icon if not specified
  2. Added consistent sizing and positioning through updated CSS properties
  3. For FLuent anchor icon size to the font size and color

Specific Changes

  • Converted all icon components to use MonochromeImageMasker:
    • AddDocumentIcon
    • AttachmentIcon
    • InfoSmallIcon
    • SendIcon
    • TelephoneKeypadIcon
  • Improved MonochromeImageMasker styles with better positioning and sizing
  • Added icon customization test
  • Updated CSS modules to properly handle new icon structure
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@OEvgeny OEvgeny marked this pull request as ready for review January 23, 2025 23:46
Copy link
Contributor

@compulim compulim left a comment

Choose a reason for hiding this comment

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

Nitpick.

compulim
compulim previously approved these changes Jan 24, 2025
Copy link
Contributor

@compulim compulim left a comment

Choose a reason for hiding this comment

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

Nitpick.

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.

2 participants