Skip to content

Commit

Permalink
Merge pull request #3035 from mhsmith/web-font
Browse files Browse the repository at this point in the history
Web backend font fixes
  • Loading branch information
freakboy3742 authored Dec 9, 2024
2 parents 15f401b + d9be0d2 commit e9f5760
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
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

0 comments on commit e9f5760

Please sign in to comment.