Files
ShakaPlayer/ui/less/buttons.less
Álvaro Velad Galván 6562859506 feat(UI): Add modern CSS theme support using CSS custom properties (#10152)
The build system is updated to generate two CSS outputs:

A legacy stylesheet (.css) where CSS custom properties are flattened
using postcss-custom-properties for compatibility with older browsers. A
modern stylesheet (.modern.css) that preserves CSS custom properties for
modern browsers.

Both outputs are generated from the same LESS source and processed
through Autoprefixer and cssnano, ensuring consistent styling while
supporting different browser capabilities. This enables a gradual
migration path between legacy and modern UI styling without breaking
existing consumers.

Close https://github.com/shaka-project/shaka-player/issues/10145
2026-06-01 09:38:58 +02:00

117 lines
2.7 KiB
Plaintext

/** @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/* The main buttons in the UI controls. */
.disabled-button() {
/* Set the background and the color, otherwise it might be overwritten by
* the css styles in demo. */
background-color: transparent;
color: var(--shaka-font-color);
cursor: default;
}
/* This button contains the current time and duration of the video.
* It's only clickable when the content is live, and current time is behind live
* edge. Otherwise, the button is disabled.
*/
.shaka-current-time {
font-size: var(--shaka-font-size);
color: var(--shaka-font-color);
cursor: pointer;
width: auto;
padding: 0 5px;
&[disabled] {
.disabled-button();
}
}
.shaka-content-title {
display: flex;
justify-content: center;
flex-direction: column;
font-size: var(--shaka-title-size);
color: var(--shaka-font-color);
width: auto;
padding: 0 5px;
/* This shadow allows good visibility with any type of background. */
text-shadow: 0 1px 3px rgba(0, 0, 0, 80%), 0 2px 6px rgba(0, 0, 0, 60%);
}
/* Use a consistent outline focus style across browsers. */
.shaka-controls-container {
button:focus, input:focus {
/* Most browsers will fall back to "Highlight" (system setting) color for
* the focus outline. */
outline: 1px solid Highlight;
}
/* Disable this Mozilla-specific focus ring, since we have an outline defined
* for focus. */
button:-moz-focus-inner, input:-moz-focus-outer {
outline: none;
border: 0;
}
}
/* Outline on focus is important for accessibility, but
* it doesn't look great. This removes the outline for
* mouse users while leaving it for keyboard users. */
.shaka-controls-container:not(.shaka-keyboard-navigation) {
button:focus, input:focus {
outline: none;
}
}
.shaka-fast-forward-container,
.shaka-rewind-container {
height: 100%;
width: 100%;
.shrinkable();
.absolute-position();
/* Keep all the elements inside button div in center and in row */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
/* To be properly positioned, this should have no margin. */
margin: 0;
/* No border. */
border: none;
color: var(--shaka-font-color);
background-color: var(--shaka-bg);
cursor: default;
font-size: 20px;
/* Hidding the container by setting opacity */
opacity: 0;
/* Make the text inside this button unselectable */
.unselectable();
}
.shaka-fast-forward-container {
border-radius: 40% 0 0 40%;
}
.shaka-rewind-container {
border-radius: 0 40% 40% 0;
}
/* This class is instead of material-icon-round
* because the font-size of 24 doesn't look good */
.shaka-forward-rewind-container-icon {
font-size: 32px;
}