Skip to content

CSS variables & parts

Set them on vega-player (or a class of players). The matching attribute, if present, wins.

PropertyDefaultUsed for
--color-primary#aaaProgress, volume, active items, spinner, retry button.
--color-controlsrgba(0,0,0,0.7)Control bar and menus.
--color-overlayrgba(0,0,0,0.95)Modal background.
--play-btn-colorrgba(255,255,255,0.9)Centre play button.
--cta-bg-color--color-primaryModal button background.
--cta-text-color#000Modal button text.
--cta-hover-bg-color#fffModal button background on hover.
--cta-hover-text-color#000Modal button text on hover.
--modal-description-colorrgba(255,255,255,0.7)Modal description.
vega-player {
--color-primary: #ff6a2b;
--color-controls: rgba(11, 7, 5, 0.82);
}
.dark-section vega-player {
--color-primary: #ffb547;
}

Style internal elements with ::part(name).

PartElement
playerThe whole player box.
videoThe <video> element.
play-buttonThe large centre play button.
controlsThe control bar.
progressThe progress bar (slider).
timeThe time display.
volumeThe volume control (button + slider).
previewThe seek preview bubble (time + thumbnail).
modalThe modal overlay.
modal-contentThe modal box.
ctaThe modal button.
errorThe error screen.
spinnerThe loading spinner.
captionsThe captions box (above the control bar).
vega-player::part(play-button) { box-shadow: 0 0 0 10px rgba(255, 181, 71, 0.16); }
vega-player::part(cta) { border-radius: 999px; text-transform: none; }
vega-player::part(preview) { font-family: 'JetBrains Mono', monospace; }
vega-player::part(video) { object-fit: contain; }
vega-player::part(captions) { font-family: Georgia, serif; }