Using Modernizr to check browser support for css calc ()

How to check if browser supports CSS3 calc () property using Modernizr?

I tried:

if (Modernizr.testProp('cssCalc')) { console.log('CSS calc() supported'); } 

but this only returns "undefined" in the console.

(I am using modernizr-2.6.2.js).

What is the correct way to use Modernizr to detect browser features?

+6
source share
1 answer
 if (Modernizr.csscalc) { console.log('CSS calc() supported'); } 
+9
source

Source: https://habr.com/ru/post/952211/


All Articles