jekyll-theme-conference 5.2.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +100 -50
  3. data/UPGRADE_GUIDE.md +16 -1
  4. data/_data/conference_assets.yml +3 -3
  5. data/_data/lang.yml +67 -39
  6. data/_includes/checks.html +9 -1
  7. data/_includes/conference_config.json +4 -4
  8. data/_includes/embed_consent.html +1 -1
  9. data/_includes/footer.html +3 -1
  10. data/_includes/get_edition.html +15 -0
  11. data/_includes/get_link.html +1 -1
  12. data/_includes/get_link_active.html +3 -1
  13. data/_includes/get_link_tag_streaming.html +22 -4
  14. data/_includes/get_live_icon.html +5 -1
  15. data/_includes/get_menu.html +2 -2
  16. data/_includes/get_page_title.html +2 -2
  17. data/_includes/get_pwa_icon.html +10 -0
  18. data/_includes/get_pwa_in.html +26 -0
  19. data/_includes/header.html +4 -5
  20. data/_includes/icon.html +12 -3
  21. data/_includes/infobox.html +6 -6
  22. data/_includes/list_header_pwa.html +15 -11
  23. data/_includes/modal_link.html +4 -3
  24. data/_includes/modal_live.html +5 -52
  25. data/_includes/navbar.html +4 -3
  26. data/_includes/navbar_pwa.html +200 -21
  27. data/_includes/pwa_install.html +4 -4
  28. data/_includes/pwa_toasts.html +39 -0
  29. data/_includes/show_link_buttons.html +1 -1
  30. data/_includes/show_menu_items.html +5 -3
  31. data/_includes/show_stream.html +63 -0
  32. data/_layouts/htaccess.html +20 -7
  33. data/_layouts/json-site.html +15 -1
  34. data/_layouts/live.html +26 -0
  35. data/_layouts/location.html +1 -1
  36. data/_layouts/manifest.html +12 -10
  37. data/_layouts/not-found.html +23 -0
  38. data/_layouts/program.html +1 -1
  39. data/_layouts/speaker.html +1 -1
  40. data/_layouts/sw.js +141 -29
  41. data/_sass/bootstrap.scss +1 -0
  42. data/_sass/theme.scss +236 -107
  43. data/assets/css/conference-only.bundle.css +1 -1
  44. data/assets/css/conference.bundle.css +1 -1
  45. data/assets/js/conference.bundle.js +2 -2
  46. metadata +7 -3
  47. data/_includes/pwa_banner.html +0 -29
  48. data/_layouts/stream-overview.html +0 -45
data/_layouts/sw.js CHANGED
@@ -1,12 +1,28 @@
1
+ {%- include get_edition.html -%}
1
2
  const BASE_URL = "{{ site.baseurl }}";
2
3
  const VERSION = "{{ site.time | date: '%Y%m%d%H%M%S' }}";
3
4
  const CACHE_PREFIX = "jekyll-conference-theme-";
4
5
  const CACHE_NAME = `${CACHE_PREFIX}${VERSION}`;
5
6
 
6
- // Fall back to the cached page when the network is this slow, e.g. on a
7
- // crowded conference Wi-Fi (the response still updates the cache)
8
- const NETWORK_TIMEOUT_MS = 3000;
9
7
  const HTTP_NOT_MODIFIED = 304;
8
+ const HTTP_NOT_FOUND = 404;
9
+
10
+ // Message to the pages once a build changed the site (_js/modules/pwa.js)
11
+ const SITE_UPDATED = "site-updated";
12
+
13
+ // Pages of each build link the site's files with its build time (e.g.
14
+ // main.css?t=1793258390): ignored, so a rebuild alone is no update
15
+ const BUILD_TIME = /\?t=\d+/g;
16
+
17
+ // Whether this build changed the site: set on install, told the pages on
18
+ // activation
19
+ let siteUpdated = false;
20
+
21
+ // Whether the latest version differs from the stored one, ignoring the build time
22
+ const isChanged = async (stored, latest) => {
23
+ const [before, after] = await Promise.all([stored.text(), latest.text()]);
24
+ return before.replace(BUILD_TIME, "") !== after.replace(BUILD_TIME, "");
25
+ };
10
26
 
11
27
  // Copy of the previous build (cache), or nothing on the first install
12
28
  const previousCache = async () => {
@@ -16,11 +32,13 @@ const previousCache = async () => {
16
32
 
17
33
  // Store a resource in the new cache, downloading only what changed since the
18
34
  // previous build: theme bundles carry their content hash (e.g.
19
- // conference.bundle.css?v=1a2b3c), all other resources are revalidated (304)
35
+ // conference.bundle.css?v=1a2b3c), all other resources are revalidated (304).
36
+ // Resolves whether it changed.
20
37
  const precache = async (cache, previous, url) => {
21
38
  const cached = previous && (await previous.match(url));
22
39
  if (cached && new URL(url, self.location.href).searchParams.has("v")) {
23
- return cache.put(url, cached);
40
+ await cache.put(url, cached);
41
+ return false;
24
42
  }
25
43
 
26
44
  const headers = {};
@@ -31,14 +49,21 @@ const precache = async (cache, previous, url) => {
31
49
  headers["If-Modified-Since"] = cached.headers.get("Last-Modified");
32
50
  }
33
51
 
34
- const response = await fetch(url, { cache: "no-store", headers });
52
+ // Low priority: the visitor's own requests go first
53
+ const response = await fetch(url, { cache: "no-store", headers, priority: "low" });
35
54
  if (response.status === HTTP_NOT_MODIFIED && cached) {
36
- return cache.put(url, cached);
55
+ await cache.put(url, cached);
56
+ return false;
37
57
  }
38
58
  if (!response.ok) {
39
59
  throw new Error(`${response.status} ${url}`);
40
60
  }
41
- return cache.put(url, response);
61
+ await cache.put(url, response.clone());
62
+
63
+ // Example: main.css?t=1793258390 of the previous build. New resources
64
+ // change the pages linking them.
65
+ const stored = previous && (await previous.match(url, { ignoreSearch: true }));
66
+ return stored ? isChanged(stored, response) : false;
42
67
  };
43
68
 
44
69
  // Install event - precache all pages and assets listed in site.json
@@ -61,6 +86,7 @@ self.addEventListener("install", (event) => {
61
86
  if (failed.length) {
62
87
  console.warn(`Service worker could not cache ${failed.length} resource(s)`);
63
88
  }
89
+ siteUpdated = results.some((result) => result.value === true);
64
90
  } catch (error) {
65
91
  console.error("Service worker install failed:", error);
66
92
  }
@@ -75,6 +101,9 @@ self.addEventListener("install", (event) => {
75
101
  self.addEventListener("activate", (event) => {
76
102
  event.waitUntil(
77
103
  (async () => {
104
+ // Request pages while the service worker boots (see fromNetwork)
105
+ await self.registration.navigationPreload?.enable();
106
+
78
107
  const cacheNames = await caches.keys();
79
108
  await Promise.all(
80
109
  cacheNames
@@ -82,36 +111,108 @@ self.addEventListener("activate", (event) => {
82
111
  .map((name) => caches.delete(name)),
83
112
  );
84
113
  await self.clients.claim();
114
+
115
+ // Once for all pages of the build, e.g. not again on the next page
116
+ if (siteUpdated) {
117
+ const clients = await self.clients.matchAll({ type: "window" });
118
+ clients.forEach((client) => client.postMessage({ type: SITE_UPDATED }));
119
+ }
85
120
  })(),
86
121
  );
87
122
  });
88
123
 
89
- // Network first: latest page, data or asset version; when offline or the
90
- // network is too slow, the cached copy (ignoring the version query, e.g.
91
- // main.css?t=1793258390)
92
- const networkFirst = async (event) => {
93
- const { request } = event;
94
- const network = fetch(request).then(async (response) => {
95
- if (response.ok) {
96
- const cache = await caches.open(CACHE_NAME);
97
- await cache.put(request, response.clone());
98
- }
99
- return response;
100
- });
124
+ // Latest version from the network, e.g. the page's navigation preload
125
+ const fetchLatest = (event) =>
126
+ (event.preloadResponse ?? Promise.resolve()).then((preloaded) => preloaded || fetch(event.request));
127
+
128
+ // Store a response for later
129
+ const store = async (request, response) => {
130
+ if (response.ok) {
131
+ const cache = await caches.open(CACHE_NAME);
132
+ await cache.put(request, response.clone());
133
+ }
134
+ return response;
135
+ };
136
+
137
+ // Latest version from the network, stored for later
138
+ const fromNetwork = (event) => {
139
+ const network = fetchLatest(event).then((response) => store(event.request, response));
101
140
  event.waitUntil(network.catch(() => {}));
141
+ return network;
142
+ };
102
143
 
103
- const timeout = new Promise((resolve) => setTimeout(resolve, NETWORK_TIMEOUT_MS));
144
+ // Store the latest version of a page shown from the cache, unless it
145
+ // changed: the next build's service worker stores all its pages at once and
146
+ // tells the pages once (see install), instead of each page on its own
147
+ const revalidatePage = async (event, cached) => {
148
+ const response = await fetchLatest(event);
149
+ if (!response.ok) {
150
+ return;
151
+ }
152
+
153
+ if (await isChanged(cached, response.clone())) {
154
+ await self.registration.update();
155
+ return;
156
+ }
157
+ await store(event.request, response);
158
+ };
159
+
160
+ // Page for missing addresses (layout: not-found, e.g. /404.html), if any
161
+ {%- assign not_found_page = site.pages | where: "layout", "not-found" | where_exp: "p", "p.edition == nil" | first -%}
162
+ {%- assign not_found_url = nil -%}
163
+ {%- if not_found_page -%}
164
+ {%- assign not_found_url = not_found_page.url | prepend: site.baseurl -%}
165
+ {%- endif %}
166
+ const NOT_FOUND_URL = {{ not_found_url | jsonify }};
167
+
168
+ // The site's page not found in place of the server's (e.g. plain text), and
169
+ // offline for pages not stored
170
+ const notFound = async (response) => {
171
+ const page = NOT_FOUND_URL && (await caches.match(NOT_FOUND_URL));
172
+ if (!page) {
173
+ return response ?? Response.error();
174
+ }
175
+ return new Response(page.body, { status: HTTP_NOT_FOUND, headers: page.headers });
176
+ };
177
+
178
+ // Page not stored (e.g. a missing one): the network, else the page not found
179
+ const pageFromNetwork = async (event) => {
180
+ let response;
104
181
  try {
105
- const response = await Promise.race([network, timeout]);
106
- if (response) {
107
- return response;
108
- }
182
+ response = await fromNetwork(event);
109
183
  } catch {
110
- // Offline: answer from the cache below
184
+ return notFound();
111
185
  }
186
+ return response.status === HTTP_NOT_FOUND ? notFound(response) : response;
187
+ };
112
188
 
113
- const cached = await caches.match(request, { ignoreSearch: true });
114
- return cached || network;
189
+ // Stale while revalidate: the cached copy right away, also on a crowded
190
+ // conference Wi-Fi, updated in the background (ignoring the query, e.g.
191
+ // /program/?day=2); the network only without a copy
192
+ const staleWhileRevalidate = async (event) => {
193
+ const cached = await caches.match(event.request, { ignoreSearch: true });
194
+ const isPage = event.request.mode === "navigate";
195
+ if (!cached) {
196
+ return isPage ? pageFromNetwork(event) : fromNetwork(event);
197
+ }
198
+
199
+ if (isPage) {
200
+ event.waitUntil(revalidatePage(event, cached.clone()).catch(() => {}));
201
+ } else {
202
+ fromNetwork(event);
203
+ }
204
+ return cached;
205
+ };
206
+
207
+ // Network first: assets not in the cache; when offline, the cached copy
208
+ // ignoring the version query (e.g. main.css?t=1793258390)
209
+ const networkFirst = async (event) => {
210
+ const network = fromNetwork(event);
211
+ try {
212
+ return await network;
213
+ } catch {
214
+ return (await caches.match(event.request, { ignoreSearch: true })) || network;
215
+ }
115
216
  };
116
217
 
117
218
  // Cache first: versioned assets do not change once cached
@@ -129,6 +230,10 @@ const cacheFirst = async (event) => (await caches.match(event.request)) || netwo
129
230
  {%- endif %}
130
231
  const DOCUMENT_PATHS = {{ document_paths | jsonify }};
131
232
 
233
+ // Start of the current edition, e.g. /2026/, to which the root forwards
234
+ // (without editions: the root itself)
235
+ const EDITION_URL = `${BASE_URL}{{ edition_base }}/`;
236
+
132
237
  // Fetch event - only handle same-origin GET requests within the site,
133
238
  // except the service worker itself and documents
134
239
  self.addEventListener("fetch", (event) => {
@@ -142,9 +247,16 @@ self.addEventListener("fetch", (event) => {
142
247
  return;
143
248
  }
144
249
 
250
+ // Forward the root (e.g. the app's start) right away, also offline, instead
251
+ // of loading its forwarding page (_layouts/editions.html)
252
+ if (request.mode === "navigate" && url.pathname === `${BASE_URL}/` && url.pathname !== EDITION_URL) {
253
+ event.respondWith(Response.redirect(`${EDITION_URL}${url.search}`));
254
+ return;
255
+ }
256
+
145
257
  // Example: /program/ (navigation) and /assets/js/data.json change during the conference
146
258
  if (request.mode === "navigate" || url.pathname.endsWith(".json")) {
147
- event.respondWith(networkFirst(event));
259
+ event.respondWith(staleWhileRevalidate(event));
148
260
  return;
149
261
  }
150
262
 
data/_sass/bootstrap.scss CHANGED
@@ -40,6 +40,7 @@
40
40
  @import "bootstrap/scss/navbar";
41
41
  @import "bootstrap/scss/offcanvas";
42
42
  @import "bootstrap/scss/tables";
43
+ @import "bootstrap/scss/toasts";
43
44
  @import "bootstrap/scss/transitions";
44
45
 
45
46
  // Include utilities API last to generate classes based on the Sass map in `_utilities.scss`
data/_sass/theme.scss CHANGED
@@ -236,6 +236,11 @@ h1.room-name,
236
236
  margin-bottom: 0;
237
237
  }
238
238
 
239
+ // Code in alerts in the alert's colour: the code colour is unreadable on its background
240
+ .alert code {
241
+ color: inherit;
242
+ }
243
+
239
244
  // Home header image: full width on small screens
240
245
  .home-header-img {
241
246
  width: 100%;
@@ -245,6 +250,142 @@ h1.room-name,
245
250
  }
246
251
  }
247
252
 
253
+ // Video and stream modals (_includes/modal_link.html, modal_live.html): on
254
+ // phones the whole screen, clear of the system's areas (e.g. the notch),
255
+ // the video in 16:9 below the title and the last footer (e.g. the rooms)
256
+ // at the bottom; on tablets wider than Bootstrap's 500 px
257
+ @include media-breakpoint-down(sm) {
258
+ .modal-fullscreen-sm-down {
259
+ .modal-content {
260
+ padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
261
+ }
262
+
263
+ .modal-body.ratio {
264
+ flex-grow: 0;
265
+ }
266
+
267
+ .modal-footer:last-of-type {
268
+ margin-top: auto;
269
+ }
270
+ }
271
+
272
+ // Stream modal: the rooms between the title and the stream (see
273
+ // _includes/show_stream.html), the last footer a close button within reach
274
+ #stream-modal .stream-rooms {
275
+ border-top: 0;
276
+ }
277
+ }
278
+
279
+ @include media-breakpoint-up(sm) {
280
+ #stream-modal .stream-rooms {
281
+ order: 1;
282
+ }
283
+ }
284
+
285
+ @include media-breakpoint-only(md) {
286
+ .modal-lg {
287
+ --#{$prefix}modal-width: #{map-get($container-max-widths, md)};
288
+ }
289
+ }
290
+
291
+ // Live stream (_includes/show_stream.html), in the modal: rooms spread
292
+ // across, the next talk's links centred
293
+ .stream-rooms {
294
+ justify-content: space-around;
295
+ }
296
+
297
+ .stream-info-links {
298
+ align-self: center;
299
+ }
300
+
301
+ // Live page (_layouts/live.html), as the modal: on phones the rooms above
302
+ // the stream, on tablets at the bottom of the screen, also while the page
303
+ // scrolls; on large screens the rooms beside the stream:
304
+ //
305
+ // ┌──────────────────┬───────┐
306
+ // │ stream │ rooms │
307
+ // ├──────────────────┤ │
308
+ // │ next talk, links │ │
309
+ // └──────────────────┴───────┘
310
+ .stream-page {
311
+ display: grid;
312
+ grid-template: "rooms" "player" "info" / minmax(0, 1fr);
313
+ gap: $spacer;
314
+
315
+ .stream-player {
316
+ grid-area: player;
317
+ overflow: hidden;
318
+ background-color: var(--#{$prefix}tertiary-bg);
319
+ @include border-radius();
320
+ }
321
+
322
+ .stream-info {
323
+ grid-area: info;
324
+ display: flex;
325
+ }
326
+
327
+ .stream-info-links {
328
+ align-self: flex-start;
329
+ }
330
+
331
+ .stream-rooms {
332
+ grid-area: rooms;
333
+ display: flex;
334
+ flex-wrap: wrap;
335
+ justify-content: center;
336
+ gap: $spacer * 0.5;
337
+ }
338
+
339
+ // Across the container, clear of the home indicator unless the app's tab
340
+ // bar below does so
341
+ @include media-breakpoint-between(sm, lg) {
342
+ grid-template: "player" auto "info" auto "rooms" 1fr / minmax(0, 1fr);
343
+ flex-grow: 1;
344
+
345
+ .stream-rooms {
346
+ position: sticky;
347
+ bottom: 0;
348
+ align-self: end;
349
+ margin: 0 calc(var(--#{$prefix}gutter-x) * -0.5);
350
+ padding: ($spacer * 0.5) calc(var(--#{$prefix}gutter-x) * 0.5) calc(#{$spacer * 0.5} + env(safe-area-inset-bottom));
351
+ background-color: var(--#{$prefix}body-bg);
352
+ border-top: var(--#{$prefix}border-width) solid var(--#{$prefix}border-color);
353
+
354
+ [data-pwa="true"] & {
355
+ padding-bottom: $spacer * 0.5;
356
+ }
357
+ }
358
+ }
359
+
360
+ @include media-breakpoint-up(lg) {
361
+ grid-template: "player rooms" auto "info ." auto / 2fr 1fr;
362
+ align-items: start;
363
+
364
+ .stream-rooms {
365
+ flex-direction: column;
366
+ }
367
+ }
368
+ }
369
+
370
+ // On tablets, the page scrolls within <main>, which fills the screen above
371
+ // the footer: the rooms then stay above the app's tab bar
372
+ @include media-breakpoint-between(sm, lg) {
373
+ body:has(.stream-page) {
374
+ display: flex;
375
+ flex-direction: column;
376
+ height: 100dvh;
377
+
378
+ main {
379
+ display: flex;
380
+ flex: 1 1 0;
381
+ flex-direction: column;
382
+ min-height: 0;
383
+ margin-bottom: 0 !important; // over .my-3
384
+ overflow-y: auto;
385
+ }
386
+ }
387
+ }
388
+
248
389
  // Dark mode
249
390
  .mode-light {
250
391
  display: initial;
@@ -262,9 +403,19 @@ h1.room-name,
262
403
  display: initial;
263
404
  }
264
405
 
265
- // PWA: in the installed app, the bottom navigation replaces the top one. It
266
- // sticks to the bottom (part of the page, so it never covers the content).
267
- @mixin pwa-mode {
406
+ // PWA: in the installed app (data-pwa, set by header.html before the first
407
+ // paint), the bottom navigation replaces the top one. It sticks to the
408
+ // bottom (part of the page, so it never covers the content). Not by
409
+ // display-mode: a site without the app opened standalone keeps its top one.
410
+ .d-pwa-block {
411
+ display: none;
412
+ }
413
+
414
+ [data-pwa="true"] {
415
+ // No bounce beyond the page's ends (iOS) or stretch (Android): it would
416
+ // move the sticky tab bar along
417
+ overscroll-behavior-y: none;
418
+
268
419
  .d-pwa-none {
269
420
  display: none;
270
421
  }
@@ -284,116 +435,94 @@ h1.room-name,
284
435
  z-index: $zindex-fixed;
285
436
  margin-top: auto;
286
437
  }
438
+
439
+ .footer-pwa .pwa-toasts {
440
+ position: absolute;
441
+ bottom: 100%;
442
+ }
443
+
444
+ // Clear the system's areas (viewport-fit=cover), e.g. the home indicator
445
+ // below and the notch beside in landscape; 0 where there are none. The
446
+ // bar stays in place while pages change (see @view-transition below)
447
+ .navbar-pwa {
448
+ view-transition-name: pwa-tabs;
449
+ padding-right: env(safe-area-inset-right);
450
+ padding-bottom: calc(var(--#{$prefix}navbar-padding-y) + env(safe-area-inset-bottom));
451
+ padding-left: env(safe-area-inset-left);
452
+ }
287
453
  }
288
454
 
289
- .d-pwa-block {
290
- display: none;
455
+ // Pages of the app cross-fade like native screens instead of flashing
456
+ @media (display-mode: standalone) and (prefers-reduced-motion: no-preference) {
457
+ @view-transition {
458
+ navigation: auto;
459
+ }
291
460
  }
292
461
 
293
- @media (display-mode: standalone), (display-mode: fullscreen) {
294
- @include pwa-mode;
462
+ // Tab bar of the app: the current tab in the primary colour
463
+ .navbar-pwa {
464
+ --#{$prefix}navbar-active-color: var(--#{$prefix}primary-text-emphasis);
295
465
  }
296
466
 
297
- [data-pwa="true"] {
298
- @include pwa-mode;
299
- }
300
-
301
- // PWA install banner (_includes/pwa_banner.html): above the page, styled
302
- // like the platform's own banners rather than the site, e.g. iOS: light
303
- // grey with a pill button (App Store), Android: Material surface and button
304
- .pwa-banner {
305
- --pwa-banner-bg: #f2f2f7;
306
- --pwa-banner-color: #000;
307
- --pwa-banner-muted: #6c6c70;
308
- --pwa-banner-border: #c6c6c8;
309
- --pwa-banner-button-bg: #e3e3e8;
310
- --pwa-banner-button-color: #005ecb; // iOS blue, darkened for contrast
311
-
312
- display: flex;
313
- align-items: center;
314
- gap: 0.75rem;
315
- padding: 0.75rem 1rem 0.75rem 0.5rem;
316
- border-bottom: 1px solid var(--pwa-banner-border);
317
- background: var(--pwa-banner-bg);
318
- color: var(--pwa-banner-color);
319
- font-family: -apple-system, system-ui, sans-serif;
320
- line-height: 1.25;
321
-
322
- [data-bs-theme="dark"] & {
323
- --pwa-banner-bg: #1c1c1e;
324
- --pwa-banner-color: #fff;
325
- --pwa-banner-muted: #98989f;
326
- --pwa-banner-border: #38383a;
327
- --pwa-banner-button-bg: #2c2c2e;
328
- --pwa-banner-button-color: #409cff;
329
- }
330
-
331
- &[data-platform="android"] {
332
- --pwa-banner-bg: #fff;
333
- --pwa-banner-color: #1f1f1f;
334
- --pwa-banner-muted: #444746;
335
- --pwa-banner-border: transparent;
336
- --pwa-banner-button-bg: #0b57d0;
337
- --pwa-banner-button-color: #fff;
338
-
339
- font-family: Roboto, "Noto Sans", system-ui, sans-serif;
340
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
341
- }
342
-
343
- [data-bs-theme="dark"] &[data-platform="android"] {
344
- --pwa-banner-bg: #1e1f20;
345
- --pwa-banner-color: #e3e3e3;
346
- --pwa-banner-muted: #c4c7c5;
347
- --pwa-banner-button-bg: #a8c7fa;
348
- --pwa-banner-button-color: #062e6f;
349
- }
350
- }
351
-
352
- .pwa-banner-close {
353
- flex-shrink: 0;
354
- padding: 0.5rem;
355
- border: 0;
356
- background: none;
357
- color: var(--pwa-banner-muted);
358
- line-height: 1;
359
- }
360
-
361
- .pwa-banner-icon {
362
- flex-shrink: 0;
363
- width: 3rem;
364
- height: 3rem;
365
- border-radius: 0.75rem;
366
- }
367
-
368
- .pwa-banner-text {
369
- display: flex;
370
- flex-direction: column;
371
- flex-grow: 1;
372
- min-width: 0;
373
-
374
- strong {
375
- font-size: 0.9375rem;
376
- }
377
-
378
- span {
379
- color: var(--pwa-banner-muted);
380
- font-size: 0.8125rem;
381
- }
382
- }
383
-
384
- .pwa-banner-install {
385
- flex-shrink: 0;
386
- padding: 0.375rem 1rem;
387
- border: 0;
388
- border-radius: 1rem;
389
- background: var(--pwa-banner-button-bg);
390
- color: var(--pwa-banner-button-color);
391
- font-weight: 600;
392
-
393
- [data-platform="android"] & {
394
- padding: 0.5rem 1.25rem;
395
- border-radius: 1.25rem;
396
- font-weight: 500;
467
+ // States of the app's tab bar (_includes/navbar_pwa.html): four tabs on
468
+ // narrow phones (e.g. iPhone mini, 375 px), five from 390 px, "-live"
469
+ // while the Live tab shows. Tabs and "More" entries with data-pwa-in show
470
+ // only in the states listed, e.g. data-pwa-in="5 5-live"
471
+ $pwa-five-tabs: 390px;
472
+
473
+ $pwa-live: ".navbar-pwa-live:not(.d-none)";
474
+
475
+ @each $suffix, $state in ("": ":not(:has(#{$pwa-live}))", "-live": ":has(#{$pwa-live})") {
476
+ :root#{$state} {
477
+ @media (max-width: #{$pwa-five-tabs - 0.02px}) {
478
+ [data-pwa-in]:not([data-pwa-in~="4#{$suffix}"]) {
479
+ display: none;
480
+ }
481
+ }
482
+
483
+ @media (min-width: $pwa-five-tabs) {
484
+ [data-pwa-in]:not([data-pwa-in~="5#{$suffix}"]) {
485
+ display: none;
486
+ }
487
+ }
488
+ }
489
+ }
490
+
491
+ // Disabled live tab (name_inactive): the icon without its pulse
492
+ .navbar-pwa .disabled .live-icon path {
493
+ animation: none;
494
+ }
495
+
496
+ // Sheets of the app's tab bar (_includes/navbar_pwa.html): items across
497
+ // the full width, above the home indicator
498
+ .navbar-pwa-sheet .offcanvas-body {
499
+ padding: 0 0 calc(var(--#{$prefix}offcanvas-padding-y) + env(safe-area-inset-bottom));
500
+ }
501
+
502
+ // Toasts of the app (_includes/pwa_toasts.html): at the bottom, across the
503
+ // width of phones. The home indicator's area takes the place of the
504
+ // spacing instead of adding to it (e.g. iOS Safari: 34 px, not 34 + 16)
505
+ .pwa-toasts {
506
+ position: fixed;
507
+ right: 0;
508
+ bottom: max(0px, env(safe-area-inset-bottom) - #{$spacer});
509
+ z-index: $zindex-toast;
510
+ padding: $spacer;
511
+
512
+ // Opaque, so the page does not show through; one at a time, so without
513
+ // Bootstrap's spacing between toasts
514
+ .toast {
515
+ --#{$prefix}toast-bg: var(--#{$prefix}body-bg);
516
+ margin-bottom: 0;
517
+ }
518
+
519
+ @include media-breakpoint-down(sm) {
520
+ left: 0;
521
+ width: auto;
522
+
523
+ .toast {
524
+ width: 100%;
525
+ }
397
526
  }
398
527
  }
399
528