is-style-supported
is-style-supported copied to clipboard
Feature test support for CSS properties and their assignable values
isStyleSupported
Feature test support for CSS properties and their assignable values
Install
Download the development or minified version, or install via NPM:
npm install @ryanmorr/is-style-supported
Usage
Provide a style property as the first argument in standard CSS notation (kebab-case/hyphenated). You can use the optional second argument to determine support for the property's assignable value as well.
import isStyleSupported from '@ryanmorr/is-style-supported';
// Feature test CSS animations
isStyleSupported('animation-name');
// Feature test the flexbox layout module
isStyleSupported('display', 'flex');
Please note, you will not be required to provide vendor prefixes for properties, that is done internally. However, this is not the case for property values which may require a vendor prefix depending on the value you wish to test.
License
This project is dedicated to the public domain as described by the Unlicense.