From 31ad8f9b67db4a0bc5a06b49d841f42a557f90d3 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Mon, 9 Dec 2024 21:41:48 +0000 Subject: [PATCH 1/2] Web backend font fixes --- web/src/toga_web/factory.py | 5 ++--- web/src/toga_web/fonts.py | 4 ++++ web/src/toga_web/static/toga.css | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 web/src/toga_web/fonts.py diff --git a/web/src/toga_web/factory.py b/web/src/toga_web/factory.py index ec246f3995..3aaa3da4fc 100644 --- a/web/src/toga_web/factory.py +++ b/web/src/toga_web/factory.py @@ -3,8 +3,7 @@ from . import dialogs from .app import App from .command import Command - -# from .fonts import Font +from .fonts import Font from .icons import Icon # from .images import Image @@ -49,7 +48,7 @@ def not_implemented(feature): "App", "Command", # Resources - # 'Font', + "Font", "Icon", # 'Image', "Paths", diff --git a/web/src/toga_web/fonts.py b/web/src/toga_web/fonts.py new file mode 100644 index 0000000000..31e25e0b5e --- /dev/null +++ b/web/src/toga_web/fonts.py @@ -0,0 +1,4 @@ +# Fonts are implemented via Pack.__css__, so this class doesn't need to do anything. +class Font: + def __init__(self, *args, **kwargs): + pass diff --git a/web/src/toga_web/static/toga.css b/web/src/toga_web/static/toga.css index 6cc3929e3c..e3aa84d253 100644 --- a/web/src/toga_web/static/toga.css +++ b/web/src/toga_web/static/toga.css @@ -12,6 +12,11 @@ html, body { margin: 0; } +#app-placeholder { + font-family: var(--sl-font-sans); + font-size: var(--sl-font-size-medium); +} + /* If a custom element hasn't been defined yet, hide it from rendering */ :not(:defined) { visibility: hidden; From d9be0d2e80298a307d892e665487441b7e7b4fbf Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Mon, 9 Dec 2024 21:58:56 +0000 Subject: [PATCH 2/2] Add change note --- changes/3035.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/3035.bugfix.rst diff --git a/changes/3035.bugfix.rst b/changes/3035.bugfix.rst new file mode 100644 index 0000000000..26d2e8852c --- /dev/null +++ b/changes/3035.bugfix.rst @@ -0,0 +1 @@ +The web backend now uses the Shoelace default font in all browsers.