diff --git a/ci/dev/gen_icons.sh b/ci/dev/gen_icons.sh index 432b8f62f..9d27486dc 100755 --- a/ci/dev/gen_icons.sh +++ b/ci/dev/gen_icons.sh @@ -21,6 +21,24 @@ main() { convert -quiet -background transparent -resize 512x512 pwa-icon.png pwa-icon-512.png # We use -quiet above to avoid https://github.com/ImageMagick/ImageMagick/issues/884 + + # The following adds dark mode support for the favicon as favicon-dark-support.svg + # There is no similar capability for pwas or .ico so we can only add support to the svg. + favicon_dark_style="" + # See https://stackoverflow.com/a/22901380/4283659 + # This escapes all newlines so that sed will accept them. + favicon_dark_style="$(printf "%s\n" "$favicon_dark_style" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g')" + sed "$( + cat -n << EOF +s% favicon-dark-support.svg } main "$@" diff --git a/src/browser/media/favicon-dark-support.svg b/src/browser/media/favicon-dark-support.svg new file mode 100644 index 000000000..06f1fa00d --- /dev/null +++ b/src/browser/media/favicon-dark-support.svg @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/browser/pages/error.html b/src/browser/pages/error.html index 4d24d85f5..73a9599bd 100644 --- a/src/browser/pages/error.html +++ b/src/browser/pages/error.html @@ -11,7 +11,7 @@ content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;" /> {{ERROR_TITLE}} - code-server - + diff --git a/src/browser/pages/login.html b/src/browser/pages/login.html index 9f74b296f..ef3f16a40 100644 --- a/src/browser/pages/login.html +++ b/src/browser/pages/login.html @@ -11,7 +11,7 @@ content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;" /> code-server login - + diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index c46cb47a2..ef61fa5eb 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -24,7 +24,7 @@ - +