This is how I do it. jsfiddle
You can use CSS Filter. This is a little hacky and limited, but this is the best we can do right now.
the following CSS changes the default color to red, but it affects the entire player even in the background if it is saturated (not black, white or shade of gray)
audio::-webkit-media-controls-panel { background: transparent; -webkit-filter: hue-rotate(143deg) saturate(10); }
therefore it is better to apply the changes separately
audio::-webkit-media-controls-volume-slider { -webkit-filter: hue-rotate(143deg) saturate(10); } audio::-webkit-media-controls-timeline { -webkit-filter: hue-rotate(143deg) saturate(10); }
How to calculate the desired hue-rotation () and saturate ()
I took the default color # 4285f4 and used Photoshop Hue / Saturation to get the wanter degrees and saturation value. but you can use any tool that you have, or calculate it yourself.
for example using tools like this or this , which converts to HSL (Hue, Saturation, Lightness)
I see that color # 4285f4 is HSL (217, 89%, 61%)
color red aka # FF0000 is HSL (0, 100%, 20%)
The hue value varies from 0 to 360 Β°, so to achieve red color I need a hue-rotation (143deg) (360 - 217) and saturated (10) 100% saturation of the desired red color. Learn more about saturate ()
for the rest of the elements, here is a list of known subselect selectors.
Webkit pseudo-element selector (Dome DOM elements)