@uncinq/css-components 1.21.0 → 1.22.1

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.
@@ -38,9 +38,9 @@
38
38
  border: 0;
39
39
  cursor: pointer;
40
40
  display: inline-flex;
41
- margin-inline-start: calc(var(--spacing-xs) * -1);
42
- padding-block: var(--spacing-2xs);
43
- padding-inline: var(--spacing-xs);
41
+ margin-inline-start: calc(var(--dropdown-toggle-padding-inline) * -1);
42
+ padding-block: var(--dropdown-toggle-padding-block);
43
+ padding-inline: var(--dropdown-toggle-padding-inline);
44
44
 
45
45
  &::before {
46
46
  content: '';
@@ -111,6 +111,7 @@
111
111
  /* ── Items ───────────────────────────────────────────────────────── */
112
112
 
113
113
  li a {
114
+ background-color: var(--dropdown-item-color-background);
114
115
  border-radius: var(--dropdown-item-border-radius);
115
116
  color: var(--dropdown-color-text);
116
117
  font-size: var(--dropdown-item-font-size);
@@ -127,14 +127,6 @@
127
127
  .btn-toggle-video {
128
128
  pointer-events: auto;
129
129
  }
130
-
131
- /* Safari draws a play button over a video it refuses to autoplay, in
132
- Low Power Mode for one. The button sits in the browser's shadow DOM,
133
- which only gives way to !important. */
134
- video::-webkit-media-controls-start-playback-button {
135
- -webkit-appearance: none;
136
- display: none !important;
137
- }
138
130
  }
139
131
 
140
132
  .surtitle {
@@ -43,9 +43,7 @@ The push takes the taller of the two boxes: a text that needs more room than the
43
43
 
44
44
  ## The media is a background
45
45
 
46
- `.media` takes `pointer-events: none`: a click on the image or the video goes through to the push and its link, and a tap never starts or pauses a video. The pause control that a [`.video`](../../embeds/video/) lays over an autoplaying video is the exception, set back to `pointer-events: auto`, since WCAG requires a way to stop it. A video that needs its native `controls` does not belong in a push.
47
-
48
- Safari draws a play button over a video it refuses to autoplay, in Low Power Mode for instance. The push hides it through `::-webkit-media-controls-start-playback-button`, with the one `!important` of the component: the button lives in the browser's shadow DOM, and nothing weaker overrides it there. The video then shows its first frame, or its poster.
46
+ `.media` takes `pointer-events: none`: a click on the image or the video goes through to the push and its link, and a tap never starts or pauses a video. The pause control that a [`.video`](../../embeds/video/) lays over an autoplaying video is the exception, set back to `pointer-events: auto`, since WCAG requires a way to stop it. A video that needs its native `controls` does not belong in a push. For the play button Safari draws over a background video in Low Power Mode, see [Video](../../embeds/video/#autoplay-checklist): no CSS hides it.
49
47
 
50
48
  ## What the push hands down
51
49
 
@@ -51,3 +51,11 @@ A [`.media`](../../content/media/) stretches the wrapper to fill it, so a video
51
51
  ## Autoplay checklist
52
52
 
53
53
  `muted` is required for autoplay to be allowed at all, and `playsinline` keeps iOS from taking the video fullscreen. `loop` is what makes a background video a background video. All three are attributes on the element, not something this component can supply.
54
+
55
+ `autoplay` itself is better left out. In Low Power Mode, or when the device runs hot, Safari refuses to autoplay and forces its own play button over every video that carries the attribute. WebKit does this on purpose, and the button lives in a closed shadow root: `::-webkit-media-controls-start-playback-button` no longer reaches it, `!important` or not. Start the video from script instead, and ignore the refusal:
56
+
57
+ ```js
58
+ video.play().catch(() => {});
59
+ ```
60
+
61
+ Without the attribute Safari draws nothing. The video stays on its poster or its first frame, and `.btn-toggle-video` is there to start it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinq/css-components",
3
- "version": "1.21.0",
3
+ "version": "1.22.1",
4
4
  "description": "Framework-agnostic CSS component implementations.",
5
5
  "license": "MIT",
6
6
  "repository": {