diff --git a/site/src/content/docs/reference/controls.mdx b/site/src/content/docs/reference/controls.mdx index eb558426..b602c38a 100644 --- a/site/src/content/docs/reference/controls.mdx +++ b/site/src/content/docs/reference/controls.mdx @@ -50,6 +50,7 @@ User activity is tracked via pointer movement, keyboard input, and focus events ## Styling By default, controls have the following styles: + ```css /* Click-through: clicks pass through controls to video beneath */ media-controls { @@ -69,10 +70,41 @@ media-controls:not([data-visible]) { opacity: 0; } ``` + + + +React renders `
` elements with the same data attributes. Add a `className` and use it as the selector: + +```css +/* Click-through: clicks pass through controls to video beneath */ +.controls { + pointer-events: none; +} + +.controls-group { + pointer-events: auto; +} + +/* Fade transition */ +.controls { + transition: opacity 0.25s; +} + +.controls:not([data-visible]) { + opacity: 0; +} +``` + ## Accessibility + No ARIA role is applied to `` — it is a layout wrapper, not a landmark. `` automatically receives `role="group"` when an `aria-label` or `aria-labelledby` attribute is provided; otherwise no role is assigned. + + + +No ARIA role is applied to `Controls.Root` — it is a layout wrapper, not a landmark. `Controls.Group` automatically receives `role="group"` when an `aria-label` or `aria-labelledby` attribute is provided; otherwise no role is assigned. + ## Examples diff --git a/site/src/content/docs/reference/fullscreen-button.mdx b/site/src/content/docs/reference/fullscreen-button.mdx index cc53fc42..ac63dd62 100644 --- a/site/src/content/docs/reference/fullscreen-button.mdx +++ b/site/src/content/docs/reference/fullscreen-button.mdx @@ -43,20 +43,43 @@ Toggles fullscreen mode. Detects platform support through `availability` — whe You can style the button based on fullscreen state: + ```css /* In fullscreen */ media-fullscreen-button[data-fullscreen] { background: red; } ``` + + + +React renders a `