Skip to content

Conversation

@marklundin
Copy link
Collaborator

@marklundin marklundin commented Apr 28, 2025

This PR broaden the color type of components to support string. Closes #110

  • Removed unused type definitions related to CSS colors in color.ts.
  • Updated the Serializable type in types-utils.ts to replace CssColor with string for better type consistency.

These changes streamline the color utility functions and enhance type safety across the codebase.

- Removed unused type definitions related to CSS colors in color.ts.
- Updated the Serializable type in types-utils.ts to replace CssColor with string for better type consistency.

These changes streamline the color utility functions and enhance type safety across the codebase.
@marklundin marklundin requested a review from Copilot April 28, 2025 14:36
@marklundin marklundin self-assigned this Apr 28, 2025
@marklundin marklundin added the enhancement New feature or request label Apr 28, 2025
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 PR broadens the color type support for components by replacing the internal CssColor type with string, streamlining color utility functions and improving type consistency.

  • Removed unused CSS color type definitions in color.ts.
  • Updated the Serializable type in types-utils.ts to use string for color values.

Reviewed Changes

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

File Description
packages/lib/src/utils/types-utils.ts Replaced CssColor with string in the Serializable type definition.
packages/lib/src/utils/color.ts Removed unused CSS color-related type definitions and commented code.
Comments suppressed due to low confidence (1)

packages/lib/src/utils/types-utils.ts:38

  • Ensure that replacing CssColor with string does not impact color value validation or formatting expectations in other parts of the codebase.
[K in keyof T]: T[K] extends Color ? string :

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 28, 2025

Open in StackBlitz

npm i https://pkg.pr.new/playcanvas/react/@playcanvas/react@117

commit: 6dbf196

@marklundin marklundin merged commit e73fb35 into main Apr 28, 2025
5 checks passed
@marklundin marklundin deleted the feat-loose-colors branch April 28, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export Colour Types

2 participants