@inglorious/ui 7.5.0 → 7.6.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.
- package/README.md +10 -7
- package/package.json +5 -4
- package/src/styles/safe-area.css +35 -4
package/README.md
CHANGED
|
@@ -46,17 +46,22 @@ The public CSS exports are:
|
|
|
46
46
|
|
|
47
47
|
## Safe-area utilities
|
|
48
48
|
|
|
49
|
-
The base styles also expose CSS variables and utility classes for
|
|
49
|
+
The base styles also expose CSS variables and utility classes for the system bars' insets: the notch, rounded corners, the home indicator and Android's status and navigation bars. They are in `base.css`, or on their own in `@inglorious/ui/safe-area.css`.
|
|
50
50
|
|
|
51
51
|
```css
|
|
52
52
|
:root {
|
|
53
|
-
--safe-area-top:
|
|
54
|
-
--safe-area-bottom:
|
|
55
|
-
--safe-area-left:
|
|
56
|
-
--safe-area-right:
|
|
53
|
+
--safe-area-top: …;
|
|
54
|
+
--safe-area-bottom: …;
|
|
55
|
+
--safe-area-left: …;
|
|
56
|
+
--safe-area-right: …;
|
|
57
57
|
}
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
They are `env(safe-area-inset-*)`, with two corrections:
|
|
61
|
+
|
|
62
|
+
- **In a Capacitor app on Android**, they use the `--safe-area-inset-*` variables Capacitor's SystemBars plugin injects. `env()` alone doubles the status bar on WebViews that Capacitor already pads natively.
|
|
63
|
+
- **In a browser tab, the top inset is 0.** The browser's chrome always sits between the page and the status bar, but browsers that embed a WebView can still report one (DuckDuckGo on Android reports 37px under its toolbar). The top inset applies in the installed PWA and in the native app, which `mount` from `@inglorious/web` marks with the `iw-native` class on `<html>`.
|
|
64
|
+
|
|
60
65
|
The following utility classes are available:
|
|
61
66
|
|
|
62
67
|
```css
|
|
@@ -73,5 +78,3 @@ The following utility classes are available:
|
|
|
73
78
|
padding-right: var(--safe-area-right);
|
|
74
79
|
}
|
|
75
80
|
```
|
|
76
|
-
|
|
77
|
-
These are useful for mobile layouts that need to respect notches, rounded corners, and the home indicator. They are intentionally generic utilities so apps can opt into them without having to define custom safe-area values repeatedly.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/ui",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "A design system for Inglorious Web with render-function components and customizable themes",
|
|
5
5
|
"author": "Matteo Antony Mistretta <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"./navigation.css": "./src/navigation/navigation.css",
|
|
36
36
|
"./surfaces.css": "./src/surfaces/surfaces.css",
|
|
37
37
|
"./tokens.css": "./src/styles/tokens.css",
|
|
38
|
+
"./safe-area.css": "./src/styles/safe-area.css",
|
|
38
39
|
"./themes/inglorious.css": "./src/styles/themes/inglorious.css",
|
|
39
40
|
"./themes/material.css": "./src/styles/themes/material.css",
|
|
40
41
|
"./themes/bootstrap.css": "./src/styles/themes/bootstrap.css",
|
|
@@ -305,10 +306,10 @@
|
|
|
305
306
|
"**/*.css"
|
|
306
307
|
],
|
|
307
308
|
"peerDependencies": {
|
|
308
|
-
"@inglorious/charts": "10.0.
|
|
309
|
+
"@inglorious/charts": "10.0.6",
|
|
309
310
|
"@inglorious/store": "11.0.3",
|
|
310
311
|
"@inglorious/utils": "5.0.0",
|
|
311
|
-
"@inglorious/web": "6.
|
|
312
|
+
"@inglorious/web": "6.6.0"
|
|
312
313
|
},
|
|
313
314
|
"devDependencies": {
|
|
314
315
|
"@fontsource/material-symbols-outlined": "^5.3.5",
|
|
@@ -317,7 +318,7 @@
|
|
|
317
318
|
"@inglorious/store": "11.0.3",
|
|
318
319
|
"@inglorious/vite-plugin-jsx": "2.0.3",
|
|
319
320
|
"@inglorious/vite-plugin-vue": "1.0.4",
|
|
320
|
-
"@inglorious/web": "6.
|
|
321
|
+
"@inglorious/web": "6.6.0",
|
|
321
322
|
"@storybook/addon-docs": "^10.6.0",
|
|
322
323
|
"@storybook/web-components-vite": "^10.6.0",
|
|
323
324
|
"happy-dom": "^20.14.0",
|
package/src/styles/safe-area.css
CHANGED
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
/* The system bars' insets.
|
|
2
|
+
|
|
3
|
+
In a native app on Android, Capacitor's SystemBars plugin injects
|
|
4
|
+
--safe-area-inset-* with the right value in every case: 0 where it pads the
|
|
5
|
+
WebView natively (WebView < 140), the real inset where the app is
|
|
6
|
+
edge-to-edge. env() is only right on the newer WebViews, and adding it on top
|
|
7
|
+
of that native padding doubles the status bar. Everywhere else there is no
|
|
8
|
+
injected variable, and env() is the fallback.
|
|
9
|
+
|
|
10
|
+
The top inset is the exception: in a browser tab the browser's own chrome
|
|
11
|
+
always sits between the page and the status bar, so it is 0 there even when
|
|
12
|
+
the browser reports otherwise. Browsers that embed a WebView can (DuckDuckGo
|
|
13
|
+
on Android says 37px with its toolbar in the way). It only applies where the
|
|
14
|
+
page can reach the status bar: the installed PWA, and the native app, which
|
|
15
|
+
`mount` from @inglorious/web marks with `iw-native`. */
|
|
1
16
|
:root {
|
|
2
|
-
--safe-area-top:
|
|
3
|
-
--safe-area-bottom:
|
|
4
|
-
|
|
5
|
-
|
|
17
|
+
--safe-area-top: var(--safe-area-inset-top, 0px);
|
|
18
|
+
--safe-area-bottom: var(
|
|
19
|
+
--safe-area-inset-bottom,
|
|
20
|
+
env(safe-area-inset-bottom, 0px)
|
|
21
|
+
);
|
|
22
|
+
--safe-area-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
|
|
23
|
+
--safe-area-right: var(
|
|
24
|
+
--safe-area-inset-right,
|
|
25
|
+
env(safe-area-inset-right, 0px)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (display-mode: standalone), (display-mode: fullscreen) {
|
|
30
|
+
:root {
|
|
31
|
+
--safe-area-top: env(safe-area-inset-top, 0px);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:root.iw-native {
|
|
36
|
+
--safe-area-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
|
|
6
37
|
}
|
|
7
38
|
|
|
8
39
|
.pt-safe {
|