Skip to content

Commit 1b1440f

Browse files
committed
Update logo
1 parent c5c764d commit 1b1440f

File tree

9 files changed

+34
-37
lines changed

9 files changed

+34
-37
lines changed

ci/dev/gen_icons.sh

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
11
#!/bin/sh
22
set -eu
33

4+
# Generate icons from a single favicon.svg. favicon.svg should have no fill
5+
# colors set.
46
main() {
57
cd src/browser/media
68

7-
# We need .ico for backwards compatibility.
8-
# The other two are the only icon sizes required by Chrome and
9-
# we use them for stuff like apple-touch-icon as well.
10-
# https://web.dev/add-manifest/
9+
# We need .ico for backwards compatibility. The other two are the only icon
10+
# sizes required by Chrome and we use them for stuff like apple-touch-icon as
11+
# well. https://web.dev/add-manifest/
1112
#
1213
# This should be enough and we can always add more if there are problems.
13-
14+
#
15+
# -quiet to avoid https://github.com/ImageMagick/ImageMagick/issues/884
1416
# -background defaults to white but we want it transparent.
17+
# -density somehow makes the image both sharper and smaller in file size.
18+
#
1519
# https://imagemagick.org/script/command-line-options.php#background
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.
20-
convert -quiet -background transparent -resize 192x192 pwa-icon.png pwa-icon-192.png
21-
convert -quiet -background transparent -resize 512x512 pwa-icon.png pwa-icon-512.png
20+
convert -quiet -background transparent \
21+
-resize 256x256 -density 256x256 \
22+
favicon.svg favicon.ico
2223

23-
# We use -quiet above to avoid https://github.com/ImageMagick/ImageMagick/issues/884
24+
# Generate PWA icons. There should be enough padding to support masking.
25+
convert -quiet -border 60x60 -bordercolor white -background white \
26+
-resize 192x192 -density 192x192 \
27+
favicon.svg pwa-icon-192.png
28+
convert -quiet -border 160x160 -bordercolor white -background white \
29+
-resize 512x512 -density 512x512 \
30+
favicon.svg pwa-icon-512.png
2431

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
32+
# The following adds dark mode support for the favicon as
33+
# favicon-dark-support.svg There is no similar capability for pwas or .ico so
34+
# we can only add support to the svg.
35+
favicon_dark_style="<style>@media (prefers-color-scheme: dark) {* { fill: white; }}</style>"
36+
cp favicon.svg favicon-dark-support.svg
37+
sed "s%<path%$favicon_dark_style\n <path%" favicon.svg > favicon-dark-support.svg
4238
}
4339

4440
main "$@"

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
in {
1515
devShells.default = pkgs.mkShell {
1616
nativeBuildInputs = with pkgs; [
17+
imagemagick
1718
nodejs
1819
python3
1920
pkg-config
Lines changed: 4 additions & 7 deletions
Loading

src/browser/media/favicon.ico

-500 Bytes
Binary file not shown.

src/browser/media/favicon.svg

Lines changed: 3 additions & 1 deletion
Loading

src/browser/media/pwa-icon-192.png

-3.6 KB
Loading

src/browser/media/pwa-icon-512.png

-9.2 KB
Loading

src/browser/media/pwa-icon.png

-18.9 KB
Binary file not shown.

src/node/routes/vscode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ router.get("/manifest.json", async (req, res) => {
190190
src: `{{BASE}}/_static/src/browser/media/pwa-icon-${size}.png`,
191191
type: "image/png",
192192
sizes: `${size}x${size}`,
193+
purpose: "maskable",
193194
})),
194195
},
195196
null,

0 commit comments

Comments
 (0)