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. 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;