Meta theme color (#547)

* feat(theme/index): Add meta tag for theme-color

* feat(theme/book): Sync theme-color meta tag with the current theme
This commit is contained in:
Sorin Davidoi 2018-01-16 13:29:20 +01:00 committed by Michael Bryan
parent 61fad2786b
commit b0e91193e9
2 changed files with 5 additions and 0 deletions

View File

@ -161,6 +161,10 @@ $( document ).ready(function() {
ace_theme = "ace/theme/dawn"; ace_theme = "ace/theme/dawn";
} }
setTimeout(function() {
document.querySelector('meta[name="theme-color"]').content = getComputedStyle(document.body).backgroundColor;
}, 1);
if (window.ace && window.editors) { if (window.ace && window.editors) {
window.editors.forEach(function(editor) { window.editors.forEach(function(editor) {
editor.setTheme(ace_theme); editor.setTheme(ace_theme);

View File

@ -6,6 +6,7 @@
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="{{ description }}"> <meta name="description" content="{{ description }}">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#ffffff" />
<base href="{{ path_to_root }}"> <base href="{{ path_to_root }}">