Created
June 18, 2019 10:36
-
-
Save linkesch/84230829fabbeedcdef1662ee2288fdd to your computer and use it in GitHub Desktop.
Check if a property is a valid CSS property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidProperty(property, value) { | |
const tmp = document.createElement('div'); | |
tmp.style.setProperty(property, value); | |
return Boolean(tmp.style.getPropertyValue(property)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment