-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[Feature Request] recommended text-color css helper #4921
Comments
|
@KaelWD Okay in this case the colors were calculated with some sort of algorithm, right? Example of light blue
|
Yes, that was originally just for theme colours (primary etc). This is something I want to revisit at some point though. |
For custom colors there is a similar situation. There are times when the light/dark versions of custom colors come too close to the text-color associated with the light/dark theme. Imagine a dark color of white and a light color of black. In this case, when the light theme is used, the text color will not be visible. Same if the dark theme is used. Adding the ability to associate a text color to the custom color (or, more generally, associate a css class) would provide developers access to more appropriately set the text color to match the background. Alternatively, determining the text-color based on the light-ness or dark-ness of the background color would also work. What started me on this was trying to get a custom color to work like the built-in color 'primary' for v-btn -- in a light theme with default theme, the text color is white--text, not black--text. Without this feature, it is possible for theme colors to unintentionally make text difficult to read. See https://codepen.io/erichorne/pen/MWgyYge for an example. |
This comment has been minimized.
This comment has been minimized.
This is happening in version 3 with the updated theme system and automatic contrast detection. Follow for future updates #12688. If you have any additional questions, please reach out to us in our Discord community. |
Can you add a way to automatically set the text color of fields. It can be pretty annoying to create a colored component and look for the recommended text-color.
If you render a dynamic colored component you always need some logic to add the correct text-color.
I could add the feature if it is needed.
Here is in exmple of the problem and a way to implement is just with css.
https://codepen.io/anon/pen/MBPLKE
The text was updated successfully, but these errors were encountered: