diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Add viewport and color-scheme meta tags
Without a viewport meta, mobile browsers assume a desktop-width page and scale it down, which is the root cause of content overflowing on small screens.
Diffstat (limited to '')
-rw-r--r--source/ui-shared.c5
1 file changed, 5 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index 69d2cdf..757e328 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -815,6 +815,11 @@ void cgit_print_docstart(void)
html(cgit_doctype);
html("<html lang='en'>\n");
html("<head>\n");
+ html("<meta charset='utf-8'/>\n");
+ html("<meta name='viewport' content='width=device-width, initial-scale=1'/>\n");
+ html("<meta name='color-scheme' content='light dark'/>\n");
+ html("<meta name='theme-color' media='(prefers-color-scheme: light)' content='#ffffff'/>\n");
+ html("<meta name='theme-color' media='(prefers-color-scheme: dark)' content='#1b1b1b'/>\n");
html("<title>");
html_txt(ctx.page.title);
html("</title>\n");