feat: adjust favicon based on system color-scheme (#10087)

This will still default to light-theme, but support showing
a white favicon when the system-theme is dark.
This commit is contained in:
Kyle Carberry
2023-10-05 16:11:15 -05:00
committed by GitHub
parent a5f8300c76
commit 1eb21d247b
5 changed files with 26 additions and 2 deletions
+18 -2
View File
@@ -28,13 +28,29 @@
<link
rel="alternate icon"
type="image/png"
href="/favicons/favicon.png"
href="/favicons/favicon-light.png"
media="(prefers-color-scheme: dark)"
data-react-helmet="true"
/>
<link
rel="icon"
type="image/svg+xml"
href="/favicons/favicon.svg"
href="/favicons/favicon-light.svg"
media="(prefers-color-scheme: dark)"
data-react-helmet="true"
/>
<link
rel="alternate icon"
type="image/png"
href="/favicons/favicon-dark.png"
media="(prefers-color-scheme: light)"
data-react-helmet="true"
/>
<link
rel="icon"
type="image/svg+xml"
href="/favicons/favicon-dark.svg"
media="(prefers-color-scheme: light)"
data-react-helmet="true"
/>
<style>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

+8
View File
@@ -0,0 +1,8 @@
<svg width="117" height="117" viewBox="0 0 117 117" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M109.69 52.8897C107.511 52.8897 106.059 51.6121 106.059 48.9897V33.9276C106.059 24.3121 102.098 19 91.8643 19H87.1107V29.1534H88.5633C92.5905 29.1534 94.5051 31.3724 94.5051 35.3396V48.6535C94.5051 54.4362 96.2216 56.7897 99.9849 58C96.2216 59.1432 94.5051 61.5638 94.5051 67.3465C94.5051 70.6415 94.5051 73.9362 94.5051 77.2312C94.5051 79.9879 94.5051 82.6776 93.7789 85.4344C93.0527 87.9897 91.8643 90.4103 90.2138 92.4947C89.2895 93.7053 88.2331 94.7138 87.0449 95.6553V97H91.7982C102.032 97 105.993 91.6879 105.993 82.0724V67.0103C105.993 64.3206 107.379 63.1103 109.624 63.1103H112.331V52.9568H109.69V52.8897Z" fill="white"/>
<path d="M77.3397 34.3331H62.683C62.3528 34.3331 62.0889 34.0641 62.0889 33.7279V32.5849C62.0889 32.2486 62.3528 31.9797 62.683 31.9797H77.4057C77.7357 31.9797 77.9998 32.2486 77.9998 32.5849V33.7279C77.9998 34.0641 77.6696 34.3331 77.3397 34.3331Z" fill="white"/>
<path d="M79.8483 48.8566H69.153C68.8228 48.8566 68.5586 48.5875 68.5586 48.2513V47.1083C68.5586 46.7722 68.8228 46.5031 69.153 46.5031H79.8483C80.1785 46.5031 80.4424 46.7722 80.4424 47.1083V48.2513C80.4424 48.5204 80.1785 48.8566 79.8483 48.8566Z" fill="white"/>
<path d="M84.0737 41.5948H62.683C62.3528 41.5948 62.0889 41.3259 62.0889 40.9897V39.8465C62.0889 39.5103 62.3528 39.2414 62.683 39.2414H84.0077C84.3379 39.2414 84.602 39.5103 84.602 39.8465V40.9897C84.602 41.2586 84.4039 41.5948 84.0737 41.5948Z" fill="white"/>
<path d="M45.7154 37.6259C47.1678 37.6259 48.6204 37.7604 50.0068 38.0966V35.3396C50.0068 31.4396 51.9874 29.1534 55.9488 29.1534H57.4012V19H52.6476C42.4142 19 38.4531 24.3121 38.4531 33.9276V38.9034C40.7637 38.0966 43.2067 37.6259 45.7154 37.6259Z" fill="white"/>
<path d="M88.5634 74.2037C87.507 65.664 81.0369 58.5364 72.7182 56.9226C70.4076 56.452 68.0967 56.3846 65.8521 56.7881C65.7861 56.7881 65.7861 56.7208 65.7201 56.7208C62.0889 48.9881 54.2985 43.8777 45.8477 43.8777C37.397 43.8777 29.6726 48.8537 25.9753 56.5864C25.9093 56.5864 25.9093 56.6537 25.8433 56.6537C23.4666 56.3846 21.0898 56.519 18.713 57.1243C10.5264 59.1414 4.32042 66.1346 3.19806 74.607C3.06602 75.4811 3 76.3552 3 77.1623C3 79.7173 4.71655 82.0708 7.22534 82.407C10.3283 82.8778 13.0352 80.457 12.9692 77.364C12.9692 76.8932 12.9692 76.3552 13.0352 75.8846C13.5634 71.5811 16.7984 67.9502 21.0237 66.9414C22.3442 66.6052 23.6646 66.5381 24.919 66.7399C28.9463 67.2778 32.9075 65.1932 34.6241 61.5623C35.8786 58.8726 37.8592 56.519 40.5001 55.2414C43.4048 53.8293 46.706 53.6278 49.7431 54.7037C52.9119 55.8467 55.2886 58.2673 56.7412 61.2932C58.2596 64.252 58.9858 66.3364 62.221 66.7399C63.5413 66.9414 67.2385 66.8743 68.625 66.807C71.3319 66.807 74.0388 67.7484 75.9534 69.6984C77.2076 71.0432 78.1319 72.7243 78.5282 74.607C79.1223 77.6329 78.3961 80.6587 76.6135 82.9449C75.359 84.5587 73.6425 85.769 71.7279 86.307C70.8036 86.5761 69.8793 86.6432 68.955 86.6432C68.4269 86.6432 67.7007 86.6432 66.8425 86.6432C64.2017 86.6432 58.5898 86.6432 54.3643 86.6432C51.4596 86.6432 49.1487 84.2899 49.1487 81.3311V71.3793V61.6293C49.1487 60.8226 48.4886 60.1502 47.6963 60.1502H45.6496C41.6222 60.2173 38.3873 64.7899 38.3873 69.6311C38.3873 74.4726 38.3873 87.3158 38.3873 87.3158C38.3873 92.5605 42.5465 96.7967 47.6963 96.7967C47.6963 96.7967 70.6057 96.7293 70.9357 96.7293C76.2173 96.1914 81.103 93.4346 84.4039 89.1984C87.7051 85.0967 89.2235 79.7173 88.5634 74.2037Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB