From f09d71082b755a7ef652cf1c9eee5c27c9386701 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 28 Dec 2022 22:31:21 -0400 Subject: better theme colors --- src/upd8.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/upd8.js') diff --git a/src/upd8.js b/src/upd8.js index d7350264..35ed7549 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -1231,11 +1231,25 @@ export function generateDocumentHTML(pageInfo, { socialEmbed.image && html.tag('meta', {property: 'og:image', content: socialEmbed.image}), - colors && - html.tag('meta', { - name: 'theme-color', - content: colors.dark, - }), + ...html.fragment( + colors && [ + html.tag('meta', { + name: 'theme-color', + content: colors.dark, + media: '(prefers-color-scheme: dark)', + }), + + html.tag('meta', { + name: 'theme-color', + content: colors.light, + media: '(prefers-color-scheme: light)', + }), + + html.tag('meta', { + name: 'theme-color', + content: colors.primary, + }), + ]), oEmbedJSONHref && html.tag('link', { -- cgit 1.3.0-6-gf8a5