Skip to content

Commit

Permalink
fix tarcking-vector image in dark-mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kaiido committed Aug 6, 2024
1 parent c095851 commit 72b942a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/wattsi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,7 @@ TCrossReferences = record
'alt', '(This is a tracking vector.)',
'width', '46',
'height', '64',
'class', 'darkmode-aware',
'crossorigin', ''])]);
(Node.ParentNode as TElement).ReplaceChild(TempElement, Node);
Node.Free();
Expand Down

0 comments on commit 72b942a

Please sign in to comment.