-
Notifications
You must be signed in to change notification settings - Fork 601
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
Add a way to provide custom styles based on design system luminance in web components #3973
Comments
@bheston, thoughts on this? Any new guidance or is the previous function equally applicable and desired here? |
We need to separate out two specific concerns:
Based on the 'benefits' question above, this issue relates to item 2. The
I was just about to write up a feature request for this. Now that we have change notifiers it seems that the design system provider could handle That would make it easier to do something like Regarding the concern in item 1, I emphasized the 'specific' nature because I think this applies to something like showing a sun or a moon icon depending on the mode. In app-level consumer code I would expect a function like this to be used very minimally. This question has come up recently regarding opacity overlay as well, looking to use one opacity in light mode and another in dark, but that needs to be addressed at the design level to understand the behavior or it breaks down when looking at personalization like a custom neutral palette and adjusted |
It's worth noting that Based on the above, is there any action we need to take on this now or can this be closed? |
The wrinkle here with @microsoft/fast-components exporting |
The function definition does not contain a deprecation doc tag https://github.com/microsoft/fast/blob/master/packages/web-components/fast-components/src/color/palette.ts#L160. Where do you see that it is deprecated? The function is exported from |
@nicholasrice - I misread...I thought your initial post referenced |
Gotcha, no worries. Yea FluentUI uses |
Closing this given #5853 |
What feature are you requesting?
In our react package
@microsoft/fast-components-msft
we had aisDarkMode()
method that would check the currentdesignSystem
luminance and return eithertrue
orfalse
. This allowed us to return 2 separate color values, classes etc. based on whether the parentsdesignSystem
was in dark mode or not.What would be the benefit of adding this feature?
One use case would be some kind of finance UI, We may want to make some text red and some text green. It may be difficult to pick one red value and one green value that would be accessible across every background.
What solution would be ideal for you?
Should we add a similar method
isDarkMode
to our web components package? OR I would expect some kind of wrapper that makes it easy to update theaccent-color
that automatically updates theaccentPalette
.What alternatives have you considered?
We could wrap those special elements in their own design system and update the accent color... But that seems overly cumbersome and heavy handed.
@bheston @nicholasrice @chrisdholt
The text was updated successfully, but these errors were encountered: