Description:
The current implementation of the isColor utility function is limited to recognizing traditional color formats such as HEX and HSL as valid colors. This limitation hinders the ability to seamlessly adapt UI components, like tables, to different themes, including dark mode, through the use of theme variables.
Proposed Enhancement:
I propose extending the isColor utility’s capabilities to include support for CSS custom properties (theme variables) as valid color definitions. This enhancement would enable developers to define and utilize a custom color palette based on theme variables, thereby facilitating a more flexible and theme-responsive design.
Example Use Case:
Consider the following scenario where a custom color palette is defined using a theme variable:
With the proposed enhancement, the isColor utility would recognize 'var(--color-danger-transparent-200)' as a valid color, allowing for its use in dynamically changing UI components based on the active theme, such as switching between light and dark modes.
📃 Other details
CKEditor version: latest
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
Description: The current implementation of the isColor utility function is limited to recognizing traditional color formats such as HEX and HSL as valid colors. This limitation hinders the ability to seamlessly adapt UI components, like tables, to different themes, including dark mode, through the use of theme variables.
Proposed Enhancement: I propose extending the isColor utility’s capabilities to include support for CSS custom properties (theme variables) as valid color definitions. This enhancement would enable developers to define and utilize a custom color palette based on theme variables, thereby facilitating a more flexible and theme-responsive design.
Example Use Case: Consider the following scenario where a custom color palette is defined using a theme variable:
With the proposed enhancement, the isColor utility would recognize 'var(--color-danger-transparent-200)' as a valid color, allowing for its use in dynamically changing UI components based on the active theme, such as switching between light and dark modes.
📃 Other details
If you'd like to see this improvement implemented, add a 👍 reaction to this post.