Bug 2071163 - Give the branding wordmarks a dark-mode fill fallback. r=sylvestre

The added rule only declares color-scheme, which is what makes light-dark() resolve; nothing competes with the context-fill in the presentation attribute, so the chrome consumers that supply one are unaffected. The fallback is what a web embed paints, since context paint is restricted to chrome://, resource:// and a short allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D325246
This commit is contained in:
Dão Gottwald
2026-09-11 09:54:04 +00:00
committed by dgottwald@mozilla.com
parent 4d90f4a736
commit 0ab1a9f0dc
4 changed files with 20 additions and 4 deletions
@@ -1,7 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill #20123a" viewBox="0 0 359 80">
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill light-dark(#20123a, #fbfbfe)" viewBox="0 0 359 80">
<!-- light-dark() in the fill fallback only resolves with a declared color-scheme. -->
<style>
:root { color-scheme: light dark }
</style>
<path
d="M0 0h52.89v11.95H15.55v23.27h28.67v11.95H15.55v31.31H0zm64 22h15.13v56.49H64zm28.88 0h13.86v10.16h1.59c1.34-3.67 3.28-6.38 5.82-8.15 2.61-1.83 5.92-2.75 9.94-2.75h8.78v11.53h-15.02c-3.38 0-5.89.95-7.51 2.86s-2.43 5.08-2.43 9.52v33.32H92.89V22ZM63.36 0h16.4v11.95h-16.4zm100.71 79.55c-8.82 0-15.69-2.54-20.63-7.62-4.87-5.15-7.3-12.38-7.3-21.69s2.43-16.5 7.3-21.58c4.94-5.15 11.81-7.72 20.63-7.72s15.27 2.36 19.99 7.09c4.73 4.73 7.09 11.42 7.09 20.1v5.08h-39.14v1.16c0 5.15.95 8.96 2.86 11.42 1.97 2.4 5.04 3.6 9.2 3.6q5.07 0 7.62-2.01 2.64-2.115 2.64-4.44v-.42h15.44c-1.62 5.5-4.65 9.73-9.1 12.69-4.37 2.89-9.91 4.34-16.61 4.34Zm12.06-35.86c-.28-4.44-1.41-7.69-3.38-9.73-1.9-2.12-4.8-3.17-8.67-3.17s-6.81 1.06-8.78 3.17c-1.9 2.05-3 5.29-3.28 9.73h24.12Zm29.62-11.74h-9.63v-9.94h9.63V9.1c0-2.89.78-5.11 2.33-6.66C209.7.82 212.03.01 215.06.01h22.85v9.94h-17.03v12.06h17.03v9.94h-17.03v46.54h-15.13zm63.89 47.6c-8.89 0-15.83-2.54-20.84-7.62-5.01-5.15-7.51-12.38-7.51-21.69s2.5-16.5 7.51-21.58c5.01-5.15 11.95-7.72 20.84-7.72s15.8 2.57 20.73 7.72c5.01 5.08 7.51 12.27 7.51 21.58s-2.5 16.54-7.51 21.69q-7.41 7.62-20.73 7.62m0-10.16c4.23 0 7.33-1.2 9.31-3.6 2.05-2.47 3.07-6.28 3.07-11.42v-8.25c0-5.15-1.02-8.92-3.07-11.32-1.97-2.47-5.08-3.7-9.31-3.7s-7.37 1.23-9.41 3.7c-2.05 2.4-3.07 6.17-3.07 11.32v8.25c0 5.15 1.02 8.96 3.07 11.42 2.05 2.4 5.18 3.6 9.41 3.6m48.87-19.99L300.32 22h15.66l12.8 20.1h1.16l12.8-20.1h15.23l-18.19 27.4 19.15 29.09h-15.45L329.62 56.7h-1.16L314.6 78.49h-15.23l19.15-29.09Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,7 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill #20123a" viewBox="0 0 359 80">
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill light-dark(#20123a, #fbfbfe)" viewBox="0 0 359 80">
<!-- light-dark() in the fill fallback only resolves with a declared color-scheme. -->
<style>
:root { color-scheme: light dark }
</style>
<path
d="M0 0h52.89v11.95H15.55v23.27h28.67v11.95H15.55v31.31H0zm64 22h15.13v56.49H64zm28.88 0h13.86v10.16h1.59c1.34-3.67 3.28-6.38 5.82-8.15 2.61-1.83 5.92-2.75 9.94-2.75h8.78v11.53h-15.02c-3.38 0-5.89.95-7.51 2.86s-2.43 5.08-2.43 9.52v33.32H92.89V22ZM63.36 0h16.4v11.95h-16.4zm100.71 79.55c-8.82 0-15.69-2.54-20.63-7.62-4.87-5.15-7.3-12.38-7.3-21.69s2.43-16.5 7.3-21.58c4.94-5.15 11.81-7.72 20.63-7.72s15.27 2.36 19.99 7.09c4.73 4.73 7.09 11.42 7.09 20.1v5.08h-39.14v1.16c0 5.15.95 8.96 2.86 11.42 1.97 2.4 5.04 3.6 9.2 3.6q5.07 0 7.62-2.01 2.64-2.115 2.64-4.44v-.42h15.44c-1.62 5.5-4.65 9.73-9.1 12.69-4.37 2.89-9.91 4.34-16.61 4.34Zm12.06-35.86c-.28-4.44-1.41-7.69-3.38-9.73-1.9-2.12-4.8-3.17-8.67-3.17s-6.81 1.06-8.78 3.17c-1.9 2.05-3 5.29-3.28 9.73h24.12Zm29.62-11.74h-9.63v-9.94h9.63V9.1c0-2.89.78-5.11 2.33-6.66C209.7.82 212.03.01 215.06.01h22.85v9.94h-17.03v12.06h17.03v9.94h-17.03v46.54h-15.13zm63.89 47.6c-8.89 0-15.83-2.54-20.84-7.62-5.01-5.15-7.51-12.38-7.51-21.69s2.5-16.5 7.51-21.58c5.01-5.15 11.95-7.72 20.84-7.72s15.8 2.57 20.73 7.72c5.01 5.08 7.51 12.27 7.51 21.58s-2.5 16.54-7.51 21.69q-7.41 7.62-20.73 7.62m0-10.16c4.23 0 7.33-1.2 9.31-3.6 2.05-2.47 3.07-6.28 3.07-11.42v-8.25c0-5.15-1.02-8.92-3.07-11.32-1.97-2.47-5.08-3.7-9.31-3.7s-7.37 1.23-9.41 3.7c-2.05 2.4-3.07 6.17-3.07 11.32v8.25c0 5.15 1.02 8.96 3.07 11.42 2.05 2.4 5.18 3.6 9.41 3.6m48.87-19.99L300.32 22h15.66l12.8 20.1h1.16l12.8-20.1h15.23l-18.19 27.4 19.15 29.09h-15.45L329.62 56.7h-1.16L314.6 78.49h-15.23l19.15-29.09Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,7 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill #20123a" viewBox="0 0 359 80">
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill light-dark(#20123a, #fbfbfe)" viewBox="0 0 359 80">
<!-- light-dark() in the fill fallback only resolves with a declared color-scheme. -->
<style>
:root { color-scheme: light dark }
</style>
<path
d="M0 0h52.89v11.95H15.55v23.27h28.67v11.95H15.55v31.31H0zm64 22h15.13v56.49H64zm28.88 0h13.86v10.16h1.59c1.34-3.67 3.28-6.38 5.82-8.15 2.61-1.83 5.92-2.75 9.94-2.75h8.78v11.53h-15.02c-3.38 0-5.89.95-7.51 2.86s-2.43 5.08-2.43 9.52v33.32H92.89V22ZM63.36 0h16.4v11.95h-16.4zm100.71 79.55c-8.82 0-15.69-2.54-20.63-7.62-4.87-5.15-7.3-12.38-7.3-21.69s2.43-16.5 7.3-21.58c4.94-5.15 11.81-7.72 20.63-7.72s15.27 2.36 19.99 7.09c4.73 4.73 7.09 11.42 7.09 20.1v5.08h-39.14v1.16c0 5.15.95 8.96 2.86 11.42 1.97 2.4 5.04 3.6 9.2 3.6q5.07 0 7.62-2.01 2.64-2.115 2.64-4.44v-.42h15.44c-1.62 5.5-4.65 9.73-9.1 12.69-4.37 2.89-9.91 4.34-16.61 4.34Zm12.06-35.86c-.28-4.44-1.41-7.69-3.38-9.73-1.9-2.12-4.8-3.17-8.67-3.17s-6.81 1.06-8.78 3.17c-1.9 2.05-3 5.29-3.28 9.73h24.12Zm29.62-11.74h-9.63v-9.94h9.63V9.1c0-2.89.78-5.11 2.33-6.66C209.7.82 212.03.01 215.06.01h22.85v9.94h-17.03v12.06h17.03v9.94h-17.03v46.54h-15.13zm63.89 47.6c-8.89 0-15.83-2.54-20.84-7.62-5.01-5.15-7.51-12.38-7.51-21.69s2.5-16.5 7.51-21.58c5.01-5.15 11.95-7.72 20.84-7.72s15.8 2.57 20.73 7.72c5.01 5.08 7.51 12.27 7.51 21.58s-2.5 16.54-7.51 21.69q-7.41 7.62-20.73 7.62m0-10.16c4.23 0 7.33-1.2 9.31-3.6 2.05-2.47 3.07-6.28 3.07-11.42v-8.25c0-5.15-1.02-8.92-3.07-11.32-1.97-2.47-5.08-3.7-9.31-3.7s-7.37 1.23-9.41 3.7c-2.05 2.4-3.07 6.17-3.07 11.32v8.25c0 5.15 1.02 8.96 3.07 11.42 2.05 2.4 5.18 3.6 9.41 3.6m48.87-19.99L300.32 22h15.66l12.8 20.1h1.16l12.8-20.1h15.23l-18.19 27.4 19.15 29.09h-15.45L329.62 56.7h-1.16L314.6 78.49h-15.23l19.15-29.09Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,7 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill #20123a" viewBox="0 0 372 99">
<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill light-dark(#20123a, #fbfbfe)" viewBox="0 0 372 99">
<!-- light-dark() in the fill fallback only resolves with a declared color-scheme. -->
<style>
:root { color-scheme: light dark }
</style>
<path
d="m334.11 76.65-21.99-56.18h15.35l13.39 37.45h2.18l13.39-37.45h14.7l-29.83 76h-15.46zM294.93 78.61c-2.98 0-5.26-.8-6.86-2.4s-2.4-3.92-2.4-6.97V0h15.03v67.83h11.21v10.78h-16.99ZM253.93 78.61c-3.05 0-5.37-.8-6.97-2.4s-2.4-3.92-2.4-6.97V31.25h-11V20.47h11V3.92h15.13v16.55h15.57v10.78h-15.57v36.58h15.57v10.78h-21.34ZM174.68 0h15.02v17.31c0 4.57-.11 8.75-.33 12.52h2.07c2.47-6.97 7.77-10.45 15.9-10.45 6.02 0 10.6 1.81 13.72 5.44s4.68 8.93 4.68 15.9v37.89h-15.13V43.55c0-4.36-.83-7.55-2.5-9.58s-4.32-3.05-7.95-3.05-6.21 1.02-7.95 3.05c-1.67 2.03-2.5 5.23-2.5 9.58v35.06h-15.02V0ZM132.52 97.56c-14.88 0-23.63-5.26-26.24-15.79h15.24v.11c0 1.23.98 2.29 2.94 3.16 2.03.87 4.61 1.31 7.73 1.31 8.57 0 12.85-3.63 12.85-10.89 0-2.9.11-5.88.33-8.93h-2.07c-1.23 3.05-3.27 5.44-6.1 7.19-2.83 1.67-6.28 2.5-10.34 2.5-6.97 0-12.52-2.5-16.66-7.51-4.06-5.01-6.1-11.83-6.1-20.47 0-5.73.94-10.78 2.83-15.13 1.89-4.36 4.54-7.73 7.95-10.13s7.4-3.59 11.98-3.59c4.21 0 7.8 1.02 10.78 3.05s5.19 4.9 6.64 8.6h2.07V20.48h13.83v55.09c0 7.11-2.36 12.56-7.08 16.33s-11.58 5.66-20.58 5.66m0-32.01c4.28 0 7.44-1.16 9.47-3.48s3.05-5.88 3.05-10.67v-6.32c0-4.79-1.02-8.35-3.05-10.67s-5.19-3.48-9.47-3.48-7.44 1.16-9.47 3.48S120 40.29 120 45.08v6.32c0 4.79 1.02 8.35 3.05 10.67s5.19 3.48 9.47 3.48M77.97 31.25H71V20.47h22.1v58.14H77.97zM77.1.22h16.44v12.3H77.1zM0 3.48h18.73l24.82 44.75h2.07c-.22-4.57-.33-9.15-.33-13.72V3.48h15.13v75.13H45.94L16.77 24.39H14.7c.22 4.57.33 9.15.33 13.72v40.5H0z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB