Skip to content

Commit af59b99

Browse files
committed
Specify <meta name="color-scheme" content="light dark">
Standard metadata names <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name>: > color-scheme: specifies one or more color schemes with which > the document is compatible. The browser will use this information > in tandem with the user's browser or device settings to determine > what colors to use for everything from background and foregrounds > to form controls and scrollbars. This also adjusts the selection/highlight colors, all CSS system colors: - https://drafts.csswg.org/css-color/#css-system-colors It could prevent "white flashes" in some contexts. The difference with the CSS `color-scheme` property [1] is, for example, with Firefox View > Page Style > No Style it still honors the browser's color theme. [1] https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
1 parent a1f2c2e commit af59b99

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/jsonformatter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ function toHTML(content: string, title: string) {
217217
return `<!DOCTYPE html>
218218
<html><head><title>${htmlEncode(title)}</title>
219219
<meta charset="utf-8">
220+
<meta name="color-scheme" content="light dark">
220221
<link rel="stylesheet" type="text/css" href="${chrome.runtime.getURL("viewer.css")}">
221222
</head><body>
222223
${content}

0 commit comments

Comments
 (0)