firstSupportedValue

fun firstSupportedValue(vararg values: String): String(source)

Returns the first property value supported by this browser for this property name.

Property values should be listed in priority order -- the earlier names in the list should ideally be matched before giving up and moving to the later names.

If no property values are supported, the first item in the list will be returned, as even if the browser can't handle it, at least the user will be able to use dev tools to see it.

The purpose of this method is to help with CSS properties that might require fallback values on different browser vendors.

For example, "width: stretch" is not, at the time of writing this comment, supported by stable Safari yet; there, they still use "width: -webkit-fill-available". So you would call:

CssPropertyName("width").firstSupportedValue("stretch", "-webkit-fill-available")

which would return "stretch" on, say, Chrome, and "-webkit-fill-available" on Safari.

It is an error to call this method with one or fewer values. In that case, you shouldn't be using it!