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
useTextColor hook #1729
Comments
Hello. Can I try this task, please? |
See also #1295 |
Take a notice that outlined VaAlert has color from https://vuestic.dev/en/ui-elements/alert#different-styles |
Should set |
Hey @m0ksem |
Alert doesn't have the prop, but I have to. |
I'm thinking how can we deal with components like date picker. It has a transparent background, so we are not able to calculate text color automatically. As a workaround, we can go through all component parent elements until we find element with background style set. Handle reactivity with MutationObserver. Not sure how it will impact performance. |
We decided to create separate tasks to add By the way @m0ksem here are some examples of parents traversing algorithms to get the real That's why @Sadnessa please feel free to ignore these comments and continue with the initial task, thanks (: |
Yes. Let's have useTextColor hook, we can improve it later with this PR #1736. |
Let's have hook, that requires one prop:
Returns
textColorComputed - returns textColor prop (if passed) or automatically calculated color
Must be used across components like VaButton, VaChip, VaCheckbox, VaSwitch, VaCollapse etc.
Text Color must be taken from getCurrentInstance
The text was updated successfully, but these errors were encountered: