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

Fix tracking-vector image in dark-mode #161

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Fix tracking-vector image in dark-mode #161

merged 1 commit into from
Aug 6, 2024

Conversation

Kaiido
Copy link
Member

@Kaiido Kaiido commented Aug 6, 2024

Since whatwg/whatwg.org#444 tracking-vector.svg is now darkmode-aware, i.e. its fill color will be dependent on the user's darkmode settings. However from whatwg/whatwg.org#439 <img> tags pointing at svg images that don't have a "darkmode-aware" class are given a white background by default. This makes the tracking-vector image fully white when seen in dark-mode. This PR aims at fixing it by adding the class on the generated <img> element.

Note that I'm not entirely sure this is the only source for this image in all the specs, but I tested it with html-build where it already handles a bunch.

Before:
Screenshot 2024-08-06 at 9 24 33 AM

After:
Screenshot 2024-08-06 at 9 25 43 AM

Since whatwg/whatwg.org#444 *tracking-vector.svg* is now darkmode-aware, i.e. its fill color will be dependent on the user's darkmode settings. However from whatwg/whatwg.org#439 `<img>` tags pointing at svg images that don't have a `"darkmode-aware"` class are given a white background by default. This makes the tracking-vector image fully white when seen in dark-mode.
This PR aims at fixing it by adding the class on the generated `<img>` element.

Note that I'm not entirely sure this is the only source for this image in all the specs, but I tested it with html-build where it already handles a bunch.
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fix HTML at least. And I suspect Bikeshed specs (i.e. other WHATWG specs) already work well?

@domenic domenic merged commit 49e7807 into whatwg:main Aug 6, 2024
1 check passed
@Kaiido
Copy link
Member Author

Kaiido commented Aug 6, 2024

I saw it in infra too, which doesn't render well no. Not sure where these should be handled from.

@domenic
Copy link
Member

domenic commented Aug 6, 2024

It'll be somewhere in https://github.com/speced/bikeshed/ then.

@Kaiido
Copy link
Member Author

Kaiido commented Aug 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants