Skip to content

Commit 8683485

Browse files
authored
docs: add styling section (#351)
* docs: add styling section fix #286 * docs: add code snippet
1 parent 1d3f534 commit 8683485

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,36 @@ The `<Video>` component with a Mux video source accepts the following additional
569569
- `liveEdgeOffset` (number): The earliest playback time that will be treated as playing "at the live edge" for live content.
570570
- `debug` (boolean): Enables debug mode for the underlying playback engine (currently hls.js) and mux-embed, providing additional information in the console.
571571

572+
573+
#### Styling the default player
574+
575+
The default theme is [Sutro](https://player.style/themes/sutro) which can be styled with CSS variables.
576+
If you are looking to completely change the layout and style it's recommended to [change the `theme` prop](#change-player-theme-demo) to a different theme or create a new theme.
577+
578+
**CSS Variables**: The default theme uses CSS variables for many colors, so you can override them in your CSS.
579+
580+
- `--media-primary-color`: The color of the control icons.
581+
- `--media-secondary-color`: The background color of the control when hovered.
582+
- `--media-accent-color`: The color of the volume slider and time slider.
583+
584+
For example:
585+
586+
```tsx
587+
import Video from 'next-video';
588+
import getStarted from '/videos/get-started.mp4';
589+
590+
export default function Page() {
591+
return <Video src={getStarted} style={{
592+
'--media-primary-color': '#fdaff3',
593+
'--media-secondary-color': '#ff0088',
594+
'--media-accent-color': '#42ffe0',
595+
}} />;
596+
}
597+
```
598+
599+
This is just the tip of the iceberg. For a full list of CSS variables, check out the [Media Chrome styling docs](https://www.media-chrome.org/docs/en/reference/styling)
600+
601+
572602
## Required Permissions for Amazon S3
573603

574604
<details>

0 commit comments

Comments
 (0)