File tree 7 files changed +35
-3
lines changed
7 files changed +35
-3
lines changed Original file line number Diff line number Diff line change
1
+ * .afdesign filter =lfs diff =lfs merge =lfs - text
Original file line number Diff line number Diff line change @@ -14,10 +14,31 @@ main() {
14
14
# -background defaults to white but we want it transparent.
15
15
# https://imagemagick.org/script/command-line-options.php#background
16
16
convert -quiet -background transparent -resize 256x256 favicon.svg favicon.ico
17
+ # We do not generate the pwa-icon from the favicon as they are slightly different
18
+ # designs and sizes.
19
+ # See favicon.afdesign and #2401 for details on the differences.
17
20
convert -quiet -background transparent -resize 192x192 pwa-icon.png pwa-icon-192.png
18
21
convert -quiet -background transparent -resize 512x512 pwa-icon.png pwa-icon-512.png
19
22
20
23
# We use -quiet above to avoid https://github.com/ImageMagick/ImageMagick/issues/884
24
+
25
+ # The following adds dark mode support for the favicon as favicon-dark-support.svg
26
+ # There is no similar capability for pwas or .ico so we can only add support to the svg.
27
+ favicon_dark_style=" <style>
28
+ @media (prefers-color-scheme: dark) {
29
+ * {
30
+ fill: white;
31
+ }
32
+ }
33
+ </style>"
34
+ # See https://stackoverflow.com/a/22901380/4283659
35
+ # This escapes all newlines so that sed will accept them.
36
+ favicon_dark_style=" $( printf " %s\n" " $favicon_dark_style " | sed -e ' :a' -e ' N' -e ' $!ba' -e ' s/\n/\\n/g' ) "
37
+ sed " $(
38
+ cat -n << EOF
39
+ s%<rect id="favicon"%$favicon_dark_style <rect id="favicon"%
40
+ EOF
41
+ ) " favicon.svg > favicon-dark-support.svg
21
42
}
22
43
23
44
main " $@ "
Original file line number Diff line number Diff line change
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:625d2049c38ae27df0613fa533020e889fa98affd603050f46d3748be7b90d0b
3
+ size 38675
Original file line number Diff line number Diff line change 11
11
content ="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:; "
12
12
/>
13
13
< title > {{ERROR_TITLE}} - code-server</ title >
14
- < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.svg " />
14
+ < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support .svg " />
15
15
< link rel ="alternate icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico " />
16
16
< link rel ="manifest " href ="{{CS_STATIC_BASE}}/src/browser/media/manifest.json " crossorigin ="use-credentials " />
17
17
< link rel ="apple-touch-icon " sizes ="192x192 " href ="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-192.png " />
Original file line number Diff line number Diff line change 11
11
content ="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:; "
12
12
/>
13
13
< title > code-server login</ title >
14
- < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.svg " />
14
+ < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support .svg " />
15
15
< link rel ="alternate icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico " />
16
16
< link rel ="manifest " href ="{{CS_STATIC_BASE}}/src/browser/media/manifest.json " crossorigin ="use-credentials " />
17
17
< link rel ="apple-touch-icon " sizes ="192x192 " href ="{{CS_STATIC_BASE}}/src/browser/media/pwa-icon-192.png " />
Original file line number Diff line number Diff line change 24
24
< meta id ="vscode-remote-nls-configuration " data-settings ="{{NLS_CONFIGURATION}} " />
25
25
26
26
<!-- Workbench Icon/Manifest/CSS -->
27
- < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.svg " />
27
+ < link rel ="icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support .svg " />
28
28
< link rel ="alternate icon " href ="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico " />
29
29
< link rel ="manifest " href ="{{CS_STATIC_BASE}}/src/browser/media/manifest.json " crossorigin ="use-credentials " />
30
30
<!-- PROD_ONLY
You can’t perform that action at this time.
0 commit comments