mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
112 lines
2.3 KiB
CSS
112 lines
2.3 KiB
CSS
/* ==========================================================================
|
|
Buttons
|
|
========================================================================== */
|
|
|
|
/* Base button */
|
|
.media-default-skin .media-button {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0.5rem 1rem;
|
|
text-align: center;
|
|
touch-action: manipulation;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
outline: 2px solid transparent;
|
|
outline-offset: -2px;
|
|
border: none;
|
|
border-radius: calc(infinity * 1px);
|
|
transition-timing-function: ease-out;
|
|
transition-duration: 150ms;
|
|
transition-property: background-color, outline-offset, scale;
|
|
/* Fix weird jumping when clicking on the buttons in Safari. */
|
|
will-change: scale;
|
|
|
|
&:focus-visible {
|
|
outline-color: currentColor;
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
&:active {
|
|
scale: 0.98;
|
|
}
|
|
|
|
&[disabled] {
|
|
cursor: not-allowed;
|
|
opacity: 0.5;
|
|
filter: grayscale(1);
|
|
}
|
|
|
|
&[data-availability="unavailable"],
|
|
&[data-availability="unsupported"] {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
/* Primary button variant */
|
|
.media-default-skin .media-button--primary {
|
|
font-weight: 500;
|
|
color: oklch(0 0 0);
|
|
text-shadow: none;
|
|
background: oklch(1 0 0);
|
|
}
|
|
|
|
/* Subtle button variant */
|
|
.media-default-skin .media-button--subtle {
|
|
color: inherit;
|
|
text-shadow: inherit;
|
|
background: transparent;
|
|
|
|
&:hover,
|
|
&:focus-visible,
|
|
&[aria-expanded="true"] {
|
|
text-decoration: none;
|
|
background-color: oklch(from currentColor l c h / 0.1);
|
|
}
|
|
}
|
|
|
|
/* Icon button variant */
|
|
.media-default-skin .media-button--icon {
|
|
display: grid;
|
|
width: 2.25rem;
|
|
aspect-ratio: 1;
|
|
padding: 0;
|
|
|
|
&:active {
|
|
scale: 0.9;
|
|
}
|
|
|
|
& .media-icon {
|
|
filter: drop-shadow(0 1px 0 var(--media-controls-current-shadow-color, oklch(0 0 0 / 0.25)));
|
|
}
|
|
}
|
|
|
|
/* Seek button */
|
|
.media-default-skin .media-button--seek {
|
|
& .media-icon__label {
|
|
position: absolute;
|
|
right: -1px;
|
|
bottom: -3px;
|
|
font-size: 10px;
|
|
font-weight: 480;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
&:has(.media-icon--flipped) .media-icon__label {
|
|
right: unset;
|
|
left: -1px;
|
|
}
|
|
}
|
|
|
|
/* Playback rate button */
|
|
.media-default-skin .media-button--playback-rate {
|
|
padding: 0;
|
|
|
|
&::after {
|
|
width: 4ch;
|
|
font-variant-numeric: tabular-nums;
|
|
content: attr(data-rate) "\00D7";
|
|
}
|
|
}
|