npm install prefixfreeA script that lets you use only unprefixed CSS properties everywhere.
It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed.
-prefix-free creates 2 global variables: StyleFix and PrefixFree. StyleFix is a framework for building various CSS fixers and -prefix-free depends on it. Currently, StyleFix is bundled with -prefix-free and only available this way, but it might eventually get split to a separate project, with separate documentation.
callback to the queue of functions that will be called when fixing CSS code. callback will be called with the following parameters:* css (String): The CSS code that is being processed,
* raw (Boolean): Whether the CSS code can contain rules etc or it's just a bunch of declarations (such as the ones found in the style attribute),
* element (HTMLElement): The node that the CSS code came from (such as a element, a element or any element with a style attribute)
and it should return the fixed CSS code.
StyleFix.link(linkElement)
Processes a element and converts it to a element with fixed code. Relative URLs will be converted.
StyleFix.styleElement(styleElement)
Fixes code inside a element.
StyleFix.styleAttribute(element)
Fixes code inside the style attribute of an element. Will not work in IE and Firefox < 3.6 due to a bug those have with getAttribute('style'): In IE invalid values of valid properties will be dropped, and in Firefox < 3.6 anything invalid will be dropped.
StyleFix.camelCase(str)
StyleFix.deCamelCase(str)
Utility methods that convert a string to camelCase and back.
'-moz-' or '-webkit-') PrefixFree.Prefix
The detected prefix of the current browser in camelCase format (like 'Moz' or 'Webkit')
PrefixFree.properties
PrefixFree.functions
PrefixFree.keywords
PrefixFree.selectors
PrefixFree.atrules
Properties/functions/keywords/etc that are only available with a prefix in the current browser.
PrefixFree.prefixSelector(selector)
PrefixFree.prefixProperty(property)
Prefixes the passed selector or property even when it's supported prefix-less. These are more internal methods and I assume they won't be too useful in general.