Skip to content

Comments

feat: solid icons css customization AB#981756#1132

Open
TarsysFonseca wants to merge 13 commits intomainfrom
feat/981756-solid-icons-css-customization
Open

feat: solid icons css customization AB#981756#1132
TarsysFonseca wants to merge 13 commits intomainfrom
feat/981756-solid-icons-css-customization

Conversation

@TarsysFonseca
Copy link
Contributor

@TarsysFonseca TarsysFonseca commented Feb 13, 2026

This pull request introduces support for multi-color (layered) icon customization using CSS variables in the bds-icon component, along with comprehensive documentation, Storybook examples, and tests to ensure backward compatibility. The most significant changes are grouped below:

Multi-Color Icon Customization Feature:

  • Added a new Storybook story, SolidIconCustomization, to demonstrate how to customize multi-color solid icons using CSS custom properties (e.g., --icon-layer-0) and to provide interactive examples and documentation for users. This story also highlights backward compatibility with existing usage.
  • Implemented and tested the ability for bds-icon to support multi-color icons where each layer's color can be overridden via CSS variables, while preserving original colors as fallbacks. This includes tests for rendering, CSS variable overrides, and fallback behavior.

Testing Improvements:

  • Expanded the test suite for bds-icon to cover scenarios for both single-color and multi-color icons, including detection logic and CSS variable application.
  • Updated type assertions in existing tests to use as unknown as { method: () => void } for improved type safety in TypeScript. [1] [2]

Code and Test Cleanup:

  • Removed unnecessary global DOM mocking in the utils.spec.ts test file, simplifying test setup.
  • Refactored the formatSvg utility tests for clarity and maintainability, using real SVG strings and focusing on relevant scenarios.

Documentation:

  • Cleaned up the readme.md file for the bds-icon component.

Corrections

facebook instagram chip folder-open side-menu sparkle-ai-color

@TarsysFonseca TarsysFonseca self-assigned this Feb 13, 2026
@TarsysFonseca TarsysFonseca added the documentation Improvements or additions to documentation label Feb 13, 2026
Copilot AI review requested due to automatic review settings February 13, 2026 19:05
@TarsysFonseca TarsysFonseca added the enhancement New feature or request label Feb 13, 2026
@github-actions
Copy link

github-actions bot commented Feb 13, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://takenet.github.io/blip-ds/pr-preview/pr-1132/

Built to branch gh-pages at 2026-02-24 12:53 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Contributor

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 pull request introduces multi-color icon customization support for the bds-icon component through CSS custom properties. The feature allows developers to override individual icon layer colors using CSS variables like --icon-layer-0, --icon-layer-1, etc. The implementation includes comprehensive documentation, interactive Storybook examples, and new unit tests.

Changes:

  • Added multi-color icon detection and CSS variable-based customization in the icon utility functions
  • Refactored tests to use real DOM elements instead of mocked DOM methods, improving test reliability
  • Added comprehensive documentation explaining the new CSS custom properties feature with usage examples and backward compatibility notes

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
src/components/icon/utils.ts Added isMultiColorIcon and applyColorVariables functions to detect and apply CSS variables to multi-color icons
src/components/icon/test/utils.spec.ts Removed mock DOM setup and added new tests for basic SVG handling scenarios
src/components/icon/test/icon.spec.ts Added comprehensive unit tests for multi-color icon customization and single vs multi-color detection
src/components/icon/readme.md Added "CSS Custom Properties" section with usage examples, backward compatibility notes, and technical details
src/components/icon/icon.stories.jsx Added interactive SolidIconCustomization story demonstrating the new feature with color pickers and various examples

Copilot AI review requested due to automatic review settings February 13, 2026 21:51
Copy link
Contributor

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

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

Copilot AI review requested due to automatic review settings February 18, 2026 17:19
Copy link
Contributor

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

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

@@ -362,9 +362,9 @@ describe('bds-icon', () => {
// Ensure component is visible and browser environment is mocked
(page.rootInstance as any).isVisible = true;
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Unexpected any. Specify a different type.

Suggested change
(page.rootInstance as any).isVisible = true;
(page.rootInstance as { isVisible: boolean }).isVisible = true;

Copilot uses AI. Check for mistakes.

// Reset svgContent to ensure it starts as undefined
(page.rootInstance as any).svgContent = undefined;
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Unexpected any. Specify a different type.

Suggested change
(page.rootInstance as any).svgContent = undefined;
const iconInstance = page.rootInstance as { svgContent?: string | undefined };
iconInstance.svgContent = undefined;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants