I want to be able to detect if the browser supports specific CSS mathematical functions like mod(), exp(), sqrt(), etc. (currently only supported by Firefox and Safari)
I tried using javascript CSS.supports('--myVar','mod(7,2)')
but that always returns true for variables.
I also tried experimenting directly in CSS using @supports
at-rule but that only works for properties.
2
Answers
Use a normal property that accepts the value of the function to check.
Chromium
Firefox
This is not true. It works for the property and the value used. The browser needs to recognize both of them.