Is -webkit-focus-ring-color a CSS variable?
Browsing through default Webkit CSS here I noticed the following piece of code:
:focus {
outline: auto 5px -webkit-focus-ring-color
}
It seems -webk开发者_JAVA百科it-focus-ring-color
is a variable of some sort. I thought CSS could not have variables. What is going on here?
That's called a vendor prefix. You can check out a previously answered question about a list of VPs here.
Regarding your question of variables in CSS, there is a way to use variables in CSS development. I'm sure there are other ways, but the most popular are {less css} and SASS.
Just to be technically pedantic, it’s a keyword (just like auto
or red
), not a variable.
And as vonkly says, it’s a keyword with a vendor prefix.
Apple’s documented it e.g. here, where they describe it as a constant.
精彩评论