Skip to content
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

Adapt time-slice selection in High Contrast Mode. #5259

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nchevobbe
Copy link
Member

Make sure the start and end grips look like button, make the
outbound of the selection even dimmer and add border to make
the selection super obvious.

Using registered property we can get the rgb component from
given values that we can then turn into SVG filters that
we can then apply on top of the icon we use, in CSS.
The time-slice zoom icon takes advantage of this new capability
to adapt to High Contrast Mode.


dark light
timeslice selected, end "grip" is hovered image image
hovered zoom icon image image
active zoom icon image image

Make sure the start and end grips look like button, make the
outboud of the selection even dimmer and add border to make
the selection super obvious.
@nchevobbe
Copy link
Member Author

I'm curious about your opinion on the second commit to have more control hover the icon colors

@mstange
Copy link
Contributor

mstange commented Dec 11, 2024

I think the filter solution is fine but you could use <feFlood> and <feComposite> so that you don't have to parse the rgba syntax. Example:

<filter id="--button-icon-color" color-interpolation-filters="sRGB">
  <feFlood flood-color="red"/>
  <feComposite operator="in" in2="SourceAlpha"/>
</filter>

@mstange
Copy link
Contributor

mstange commented Dec 11, 2024

Oh, I found an even better solution! You can use FillPaint in combination with the fill property! I didn't realize this worked for HTML elements, too.

<filter id="--use-fill-color" color-interpolation-filters="sRGB">
  <feComposite operator="in" in="FillPaint" in2="SourceAlpha"/>
</filter>
fill: green;
filter: url(#--use-fill-color);

@nchevobbe
Copy link
Member Author

Oh, I found an even better solution! You can use FillPaint in combination with the fill property! I didn't realize this worked for HTML elements, too.

<filter id="--use-fill-color" color-interpolation-filters="sRGB">
  <feComposite operator="in" in="FillPaint" in2="SourceAlpha"/>
</filter>
fill: green;
filter: url(#--use-fill-color);

Unfortunately this doesn't seem to work in Chromium browser. Would have been nice!

I think the filter solution is fine but you could use <feFlood> and <feComposite> so that you don't have to parse the rgba syntax. Example:

<filter id="--button-icon-color" color-interpolation-filters="sRGB">
  <feFlood flood-color="red"/>
  <feComposite operator="in" in2="SourceAlpha"/>
</filter>

Ah yes that's better, I'll do that

Using registered property we can get the rgb component from
given values that we can then turn into SVG filters that
we can then apply on top of the icon we use, in CSS.
The time-slice zoom icon takes advantage of this new capability
to adapt to High Contrast Mode.
@nchevobbe
Copy link
Member Author

I don't really know flow, so not sure what's needed to please it here

@nchevobbe nchevobbe added the accessibility Related to making the profiler UI accessible label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to making the profiler UI accessible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants