Forgotten variable in CSS
See original GitHub issueExpected behavior
Don’t have undefined CSS variables.
Actual behavior
There are undefined CSS Variables
Steps to reproduce
If you look there, you’ll see this declaration:
::-webkit-slider-runnable-track{
background:0 0;
border:0;
border-radius:3px;
height:6px;
transition:all .3s ease;
-webkit-user-select:none;
user-select:none;
background-image:linear-gradient(to right,currentColor var(--value),transparent var(--value))
}
Which has the --value
variable there. Comes from here https://github.com/sampotts/plyr/blob/600f0eb8a3cf49f5268e5c15487797d496bc19b6/src/sass/components/sliders.scss#L22
It does seem the only element having a var notation. Keen to submit a PR but unsure what the intended value was.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
how to reset a CSS variable (aka custom properties) and use ...
I am trying to have CSS variables for box model properties. I want to support both setting a value for all sides as...
Read more >var() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The var() CSS function can be used to insert the value of a custom property (sometimes called a "CSS variable") instead of any...
Read more >Everything you need to know about CSS Variables
Once a variable has been defined and assigned a value, you can go ahead and use it within a property value. There's a...
Read more >What no one told you about CSS Variables
To use easy words: a CSS variable will make the status of a property in a standby mode until we do the evaluation....
Read more >How to use variables in CSS - SitePoint
CSS Variables (officially known as custom properties) are user defined values that can be set once and used many times throughout your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot for the inside. When I inspected the shadow dom and saw the value progressing then it struck me. Really clever!
Sorry for the abrupt answer. Basically all browsers have capacity to allow you to style the “lower fill” of an
<input type="range">
slider. Edge even allows you to style both sides! WebKit however is missing this, for whatever reason. In v2 I dealt with this by displaying a<progress>
behind the slider but always felt it was a hack and then discovered it was possible to use JS + CSS variables (since WebKit supported them ages ago) to set the values of a background gradient instead. This is the JavaScript part of it:https://github.com/sampotts/plyr/blob/master/src/js/controls.js#L15