Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e5f742e
Web Backend CDN Shoelace 2.3.0 > WebAwesome 3.3.1
shalgrim Mar 21, 2026
f3e14a5
Migrate web widgets from Shoelace to WebAwesome
shalgrim Mar 21, 2026
01109ef
Migrate app dialogs and menus to WebAwesome API
shalgrim Mar 21, 2026
b6f51bc
Update doco references from Shoelace to WebAwesome
shalgrim Mar 21, 2026
50f234c
Update examples for WebAwesome
shalgrim Mar 21, 2026
7c2bbf6
Add changelog
shalgrim Mar 21, 2026
bfa301a
Remove deprecated style_framework from example apps
shalgrim Mar 23, 2026
e2cd976
Use WebAwesome dist-cdn for browser loading; remove stray sandbox.html
shalgrim Mar 24, 2026
91b612f
get slider demo working on web
shalgrim Mar 27, 2026
1617576
Guard against WebAwesome async element upgrade in widget property access
shalgrim Mar 27, 2026
a428b30
linting
shalgrim Mar 27, 2026
9e2673e
clean up obsolete comment
shalgrim Mar 27, 2026
94f8ccc
linting
shalgrim Mar 27, 2026
8dc2adb
linting
shalgrim Mar 27, 2026
270ac50
trigger CI
shalgrim Mar 27, 2026
3ae00b3
Merge remote-tracking branch 'upstream/main' into 4227-shoelace-to-we…
shalgrim Apr 14, 2026
7e7ccf5
Replace helpers with buffered-replay NativeProxy
shalgrim Apr 15, 2026
49411a1
Merge branch 'main' into 4227-shoelace-to-webawesome
shalgrim Apr 15, 2026
4fd0335
linting
shalgrim Apr 15, 2026
7fba260
maintain write order on elements post-upgrade
shalgrim Apr 15, 2026
19c4b55
defaults on pre-upgraded dateinput and timeinput
shalgrim Apr 15, 2026
915ee38
Port theming tokens to WebAwesome and outline buttons
shalgrim Apr 16, 2026
0ca1fef
make header bar closer to shoelace color
shalgrim Apr 16, 2026
ece4ca4
auto-unwrap
shalgrim Apr 16, 2026
aff9fb6
Window needs to unwrap widgets in set_content
shalgrim Apr 16, 2026
4fd442d
comments for clarity
shalgrim Apr 16, 2026
db21b90
Correct some widget registrations.
freakboy3742 Apr 19, 2026
6624267
Merge branch '4227-shoelace-to-webawesome' of github.com:shalgrim/tog…
shalgrim Apr 26, 2026
aef4509
formatting
shalgrim Apr 26, 2026
cab4774
Fix Box.insert_child and remove_child in web backend
shalgrim Apr 26, 2026
4e24e4a
Activate WA shoelace compatibility theme; adjust header color
shalgrim Apr 26, 2026
22894a2
Merge remote-tracking branch 'upstream/main' into 4227-shoelace-to-we…
shalgrim Apr 26, 2026
327e369
Fix ActivityIndicator visibility: use classList instead of inline style
shalgrim Apr 27, 2026
374cfc8
Fix Slider on_release routing via document-level pointerup listener
shalgrim Apr 27, 2026
451ae06
Fix text color on wa-switch and wa-button (pre-existing bug)
shalgrim Apr 27, 2026
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/4227.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The web backend now uses WebAwesome instead of Shoelace to provide web components.
2 changes: 1 addition & 1 deletion docs/en/how-to/contribute/what/implement-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Don't worry if you don't have an idea for a new feature, there are [plenty of fe

### Implement a platform native widget

If the core library already specifies an interface for a widget, but the widget isn't implemented on your platform of choice, implement that interface. The [API reference table](/reference/api/index.md) table can show you the widgets that are missing on various platforms. You can also look for log messages in a running app (or the direct `factory.not_implemented()` function calls that produce those log messages). At present, Qt, the Web and Textual backends have the most missing widgets. If you have web skills, or would like to learn more about [PyScript](https://pyscript.net) and [Shoelace](https://shoelace.style), the web backend could be a good place to contribute; if you'd like to learn more about terminal applications or the [Textual](https://textual.textualize.io) API, contributing to the Textual backend could be a good place for you to contribute. If you’re interested in desktop GUI development or want to deepen your understanding of the Qt framework, contributing to the [Qt](https://www.qt.io/product/framework) backend is a great option.
If the core library already specifies an interface for a widget, but the widget isn't implemented on your platform of choice, implement that interface. The [API reference table](/reference/api/index.md) table can show you the widgets that are missing on various platforms. You can also look for log messages in a running app (or the direct `factory.not_implemented()` function calls that produce those log messages). At present, Qt, the Web and Textual backends have the most missing widgets. If you have web skills, or would like to learn more about [PyScript](https://pyscript.net) and [WebAwesome](https://www.webawesome.com), the web backend could be a good place to contribute; if you'd like to learn more about terminal applications or the [Textual](https://textual.textualize.io) API, contributing to the Textual backend could be a good place for you to contribute. If you’re interested in desktop GUI development or want to deepen your understanding of the Qt framework, contributing to the [Qt](https://www.qt.io/product/framework) backend is a great option.

Alternatively, if there's a widget that doesn't exist, propose an interface design, and implement it for at least one platform. You may find [this presentation by BeeWare emeritus team member Dan Yeaw](https://www.youtube.com/watch?v=sWt_sEZUiY8) helpful. This talk gives an architectural overview of Toga, as well as providing a guide to the process of adding new widgets.

Expand Down
4 changes: 2 additions & 2 deletions docs/en/reference/platforms/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Web backend is currently proof-of-concept only. Most widgets have not been i

## Prerequisites

`toga-web` will run in any modern browser. It requires [PyScript](https://pyscript.net) 2023.05.01 or newer, and [Shoelace v2.3](https://shoelace.style).
`toga-web` will run in any modern browser. It requires [PyScript](https://pyscript.net) 2023.05.01 or newer, and [WebAwesome v3.3](https://www.webawesome.com).

## Installation

Expand All @@ -19,6 +19,6 @@ The recommended approach for deploying `toga-web` is to use [Briefcase](https://

## Implementation details

The `toga-web` backend is implemented using [Shoelace web components](https://shoelace.style).
The `toga-web` backend is implemented using [WebAwesome web components](https://www.webawesome.com).

The DOM is accessed using [PyScript](https://pyscript.net).
1 change: 1 addition & 0 deletions docs/spelling_wordlist
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ viewport
watchOS
Wayland
WebKit
WebAwesome
WebView
WebViews
WGS
Expand Down
1 change: 0 additions & 1 deletion examples/activityindicator/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
Comment thread
freakboy3742 marked this conversation as resolved.
1 change: 0 additions & 1 deletion examples/beeliza/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/box/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/button/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/canvas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/colors/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/command/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/date_and_time/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/detailedlist/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/dialogs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/divider/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/examples_overview/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/focus/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/font/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/font_size/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/handlers/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/imageview/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/layout/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/mapview/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/multilinetextinput/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/numberinput/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/optioncontainer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/passwordinput/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
'../../web',
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/positron-django/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/positron-static/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/progressbar/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/resize/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/scrollcontainer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/selection/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/simpleapp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/slider/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/splitcontainer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/switch_demo/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/table/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/table_columns/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/table_source/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/textinput/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tree/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tree_source/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tutorial0/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
40 changes: 17 additions & 23 deletions examples/tutorial0/sandbox.html
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is actually a stray - it shouldn't exist in the repo at all. It's evidently some cruft that got accidentally committed when we first added Shoelace support.

Comment thread
freakboy3742 marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/themes/light.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/themes/dark.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/shoelace-autoloader.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/styles/themes/shoelace.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/styles/webawesome.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/webawesome.loader.js"></script>
<style>
* {
box-sizing: border-box;
Expand Down Expand Up @@ -79,38 +79,32 @@
</style>
</head>
<body id="app-placeholder">
<header class="toga sl-theme-dark">
<header class="toga">
<a class="brand"><img src="static/logo-32.png" alt="First App logo" loading="lazy"></a>
<nav class="menubar">
<span slot="trigger" class="app">First App</span>
<sl-dropdown>
<wa-dropdown>
<span slot="trigger" class="menu">File</span>
<sl-menu class="sl-theme-light">
<sl-menu-item>About</sl-menu-item>
<sl-menu-item>Preferences</sl-menu-item>
</sl-menu>
</sl-dropdown>
<sl-dropdown>
<wa-dropdown-item>About</wa-dropdown-item>
<wa-dropdown-item>Preferences</wa-dropdown-item>
</wa-dropdown>
<wa-dropdown>
<span slot="trigger" class="menu">Command</span>
<sl-menu class="sl-theme-light">
<sl-menu-item>About</sl-menu-item>
<sl-menu-item>Preferences</sl-menu-item>
</sl-menu>
</sl-dropdown>
<wa-dropdown-item>About</wa-dropdown-item>
<wa-dropdown-item>Preferences</wa-dropdown-item>
</wa-dropdown>
</nav>
<nav class="menubar">
<sl-dropdown>
<wa-dropdown>
<span slot="trigger" class="menu">Help</span>
<sl-menu class="sl-theme-light">
<sl-menu-item>About</sl-menu-item>
<sl-menu-item>Preferences</sl-menu-item>
</sl-menu>
</sl-dropdown>
<wa-dropdown-item>About</wa-dropdown-item>
<wa-dropdown-item>Preferences</wa-dropdown-item>
</wa-dropdown>
</nav>
</header>
<main class="toga window container">
<div id="toga_19512792" class="box container" style="flex-direction: row; flex: 0 0 0px;">
<sl-button id="toga_18434560" class="button" style="flex-direction: row; flex: 1 0 0px; margin:50px;">Hello world</sl-button>
<wa-button id="toga_18434560" class="button" style="flex-direction: row; flex: 1 0 0px; margin:50px;">Hello world</wa-button>
</div>
</main>
</body>
Expand Down
1 change: 0 additions & 1 deletion examples/tutorial1/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tutorial2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tutorial3/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/tutorial4/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/webview/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ chaquopy.defaultConfig.staticProxy("toga_android.widgets.internal.webview")
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
1 change: 0 additions & 1 deletion examples/window/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ build_gradle_dependencies = [
requires = [
"../../web",
]
style_framework = "Shoelace v2.3"
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![BSD-3-Clause License](https://img.shields.io/pypi/l/toga-web.svg)](https://github.com/beeware/toga-web/blob/main/LICENSE)
[![Project status](https://img.shields.io/pypi/status/toga-web.svg)](https://pypi.python.org/pypi/toga-web)

A backend for the [Toga widget toolkit](https://beeware.org/toga) on web platforms. It uses [Shoelace](https://shoelace.style) to provide web components.
A backend for the [Toga widget toolkit](https://beeware.org/toga) on web platforms. It uses [WebAwesome](https://www.webawesome.com) to provide web components.

This package isn't much use by itself; it needs to be combined with [the core Toga library](https://pypi.python.org/pypi/toga-core).

Expand Down
14 changes: 7 additions & 7 deletions web/src/toga_web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def show_about_dialog(self):
copyright = f"\n\nCopyright © {self.interface.author}"

close_button = create_element(
"sl-button", slot="footer", variant="primary", content="Ok"
"wa-button", slot="footer", variant="brand", content="Ok"
)
about_dialog = create_element(
"sl-dialog",
"wa-dialog",
id="toga-about-dialog",
label="About",
children=[
Expand All @@ -111,23 +111,23 @@ def show_about_dialog(self):
# Create a button handler to capture the close,
# and destroy the dialog
def dialog_close(event):
about_dialog.hide()
about_dialog.open = False
self.native.removeChild(about_dialog)

close_button.onclick = dialog_close

# Add the dialog to the DOM.
self.native.appendChild(about_dialog)

# If this is the first time a dialog is being shown, the Shoelace
# If this is the first time a dialog is being shown, the WebAwesome
# autoloader needs to construct the Dialog custom element. We can't
# display the dialog until that element has been fully loaded and
# constructed. Only show the dialog when the promise of <sl-dialog>
# constructed. Only show the dialog when the promise of <wa-dialog>
# element construction has been fulfilled.
def show_dialog(promise):
about_dialog.show()
about_dialog.open = True

js.customElements.whenDefined("sl-dialog").then(show_dialog)
js.customElements.whenDefined("wa-dialog").then(show_dialog)

######################################################################
# Cursor control
Expand Down
7 changes: 4 additions & 3 deletions web/src/toga_web/deploy/inserts/index.html~head
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- Shoelace -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/themes/light.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.3.0/dist/shoelace.js"></script>
<!-- WebAwesome -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/styles/themes/shoelace.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/styles/webawesome.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.3.1/dist/webawesome.loader.js"></script>
Loading