Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web backend font fixes #3035

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/3035.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The web backend now uses the Shoelace default font in all browsers.
5 changes: 2 additions & 3 deletions web/src/toga_web/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,7 +48,7 @@ def not_implemented(feature):
"App",
"Command",
# Resources
# 'Font',
"Font",
"Icon",
# 'Image',
"Paths",
Expand Down
4 changes: 4 additions & 0 deletions web/src/toga_web/fonts.py
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions web/src/toga_web/static/toga.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading