You can detect if a browser supports a specific or multiple CSS features using the CSS.supports
function. It can receive two parameters, the first one is the name of the feature and the second one is the value. For example, if you run CSS.supports("gap", "1rem")
, it'll return a boolean
indicating if the browser supports the feature or not.
But if you run CSS.supports("font-display", "swap")
or try to check if the browser supports any other @font-face descriptors, the function will always return false
.
So, what is the correct syntax or way to detect support for @font-face descriptors using the CSS.supports()
function? Or, is it even possible? If not then is there any alternative way?