@passui/tokens 0.2.1 → 0.2.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/styles/base.css +29 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passui/tokens",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Framework independent Passui design tokens and shared styles.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/styles/base.css CHANGED
@@ -18,9 +18,11 @@
18
18
 
19
19
  html {
20
20
  @apply font-sans;
21
- /* The colour behind the page: what shows when iOS rubber-bands past
22
- either edge. Apps point `--overscroll-color` at their bar colour. */
23
- background-color: var(--overscroll-color, var(--color-background));
21
+ /* The colour behind the page: what shows past either edge, and what
22
+ iOS Safari's floating bars sample. It is the page colour, so nothing
23
+ foreign ever shows under a bar; where scroll timelines exist it
24
+ follows the scroll (see the end of this file). */
25
+ background-color: var(--color-background);
24
26
  height: 100%;
25
27
  -webkit-font-smoothing: antialiased;
26
28
  -moz-osx-font-smoothing: grayscale;
@@ -158,3 +160,27 @@
158
160
  :root[data-os="ios"] [data-slot$="-overlay"] {
159
161
  bottom: var(--ios-edge-gap, 4px);
160
162
  }
163
+
164
+ /*
165
+ * The colour behind the page follows the scroll: `--overscroll-color` (an
166
+ * app's bar colour) at the top, the page colour at the bottom. Pulling past
167
+ * the top shows the bar's colour, and the area under Safari's floating
168
+ * bottom bar is always the page colour. The animation clamps at both ends,
169
+ * so rubber-banding shows each end's colour. A page too short to scroll
170
+ * has no timeline and keeps the plain page colour.
171
+ */
172
+ @keyframes passui-backdrop {
173
+ from {
174
+ background-color: var(--overscroll-color, var(--color-background));
175
+ }
176
+ to {
177
+ background-color: var(--color-background);
178
+ }
179
+ }
180
+
181
+ @supports (animation-timeline: scroll()) {
182
+ html {
183
+ animation: passui-backdrop linear both;
184
+ animation-timeline: scroll(root block);
185
+ }
186
+ }