-
Notifications
You must be signed in to change notification settings - Fork 686
Override fluentui-blazor error hex, darken trace duration background #1240
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
Conversation
7951ed4
to
656e4b2
Compare
For #689, the subtext still has contrast issues with the new duration color in both light and dark mode: One suggestion we had gotten from UX folks was to make the subtext color the same as the regular color when it is on a highlighted background like that (and that's what I did in #1231 ). But in this case we have no way to know whether the subtext is over the duration color or the regular background color. |
I didn't consider the subtext. We could make it the same color if any of the row is highlighted? |
@@ -151,6 +151,10 @@ fluent-data-grid-cell .long-inner-content { | |||
color: var(--neutral-foreground-rest); | |||
} | |||
|
|||
:root { | |||
--error: #F8040A !important; /* the default error color (#BC2F32) is not accessible in dark theme */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vnbaaij I think the !important
here is necessary because variables is included dynamically via the blazor module injection (indirectly via the Microsoft.FluentUI.AspNetCore.Components.css
) so it comes last and we can't override with our own. Is there any way to avoid that, especially since there's so little in that file? I guess this will all change in 4.2 because of Javier's changes, right? So maybe best to leave this and deal with it after that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changes are occurring in 4.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I was referring to: microsoft/fluentui-blazor#1051
That moved some of the CSS into JS and adopted stylesheets. E.g. what was in variables.css is now here: https://github.com/microsoft/fluentui-blazor/blob/34b60e1bcd924dbef9ce3e24ae3de76ae3f21711/src/Core.Assets/src/index.ts#L15C1-L29C2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked for clarity on when that will be released.
The problem here is that its not really highlighted vs not - every row will have some duration, so there'll always be some of this duration background (it may be so small you can't see it, but where it falls compared to the rest of the contents of the row is based on the duration and the screen size, etc). |
It seems to me like the right solution is just to make the subtext the same as the main text color, as it has sufficient contrast on both backgrounds |
If we remove the ghosting of the text, should we do something else to set it off from the rest of the text there? Put it in paren? Separate it with a pipe? Or is it ok as is? @JamesNK guessing you'll have thoughts on that. |
Feedback:
|
@@ -151,6 +151,10 @@ fluent-data-grid-cell .long-inner-content { | |||
color: var(--neutral-foreground-rest); | |||
} | |||
|
|||
:root { | |||
--error: #F8040A !important; /* the default error color (#BC2F32) is not accessible in dark theme */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a :root
section earlier in this file. Move this variable to it.
The set values are at the edge of allowable contrast for light theme - it can be darkened slightly in dark theme. At least for gray, it is not possible to go lighter (for light theme). @JamesNK The ghosted text is a problem, but is not the only problem. |
waiting on this until |
I'm confused about this statement because other colors throughout the app already have lighter backgrounds: Here is dark mode: The colors used to highlight the details pane look much better. |
@JamesNK Those are different scenarios, where there is no required contrast ratio. Here, being that the color indicates state, we are bound by WCAG 1.4.11 (see link for specific criteria) to ensure a contrast ratio of 3:1.
Aesthetically I agree with you, but that isn't relevant to the contrast problem. I'm happy to suggest a range of different colors for your thoughts, or we can indicate the trace's duration as a % of total in some other way. |
@tlmii and @drewnoakes as well for thoughts ^ |
I'd rather remove the trace duration indicator that have it look like this. |
We could also indicate percentage using a progress bar or ring. What do you think of that idea @JamesNK |
I'm not sure what you mean. Each row is kind of a progress bar today. Are you thinking of adding a very small graph in the grid? The problem with adding new content is screen real-estate is limited, so something else will have to be made smaller. |
Not a graph, but adding a fluent Progress https://www.fluentui-blazor.net/Progress or possibly progress circle component somewhere in the row |
We run into the problem that unless it is very large (like it is now, where it takes up the whole row), it can be hard to tell relative lengths (other than the overall vs all the smaller ones), so I'd worry making it only take up one column's width or something would diminish the value too much. I do think this is worth getting an a11y expert opinion on this at some point. @kvenkatrajan or @leslierichardson95 Do you think we should take this to office hours? I don't think we really discussed this particular one during the UX board meeting a couple weeks ago. I think there's value in the subtle duration bars, if we can come up with a way to ensure the same information is available to everyone (note that I don't think it has to be making the subtle duration bars meet all the rules if we can have an additional way to display the same info). |
I played around with a percentage ring icon. I think it's not bad. PR here: #1387 |
Right, the complication is ensuring it is available in some way to non-visual users. I would suggest a progress ring if we do want to convey this information. |
#1387 is merged. This PR can be simplified to changing the error color. |
f47dd78
to
4e334a5
Compare
Simplifying PR to just changing error color & updating fluentui. Still using this PR to keep the conversation history |
Just modified for dark theme, as light theme --error can stay the same. !important is still needed, unfortunately. @tlmii @drewnoakes |
Fixes #690 and #689
For #689, I darkened the background color, which looks like this on light and dark theme:


Both contrasts meet WCAG guidelines for text on background, and between the row and package backgrounds. Other color suggestions are welcome as well. This is ##938989
For #690, I override --error to be more red, as this is an issue in the three places that
Color.Error
shows up. We could ask to change the default in fluentui-blazor. This is one of the lightest possible shades we can choose, with a dark theme contrast of ~3.0.