<link> or <style> elements and adds a vendor prefix where neededstyle attribute and adds a vendor prefix where needed<link> or <style> elements, style attribute changes and CSSOM changes (requires plugin).css() method to get and set unprefixed properties (requires plugin)@import-ed files is not supportedstyle attribute) won’t work in IE and Firefox 3.6 and below.Check this page’s stylesheet ;-)
BTW: This page is a bit slow, because I went crazy with the CSS3 in it, to demonstrate prefixfree. It’s not prefixfree making it slow.
Just include prefixfree.js anywhere in your page. It is recommended to put it right after the stylesheets, to minimize FOUC
That’s it, you’re done!
The target browser support is IE9+, Opera 10+, Firefox 3.5+, Safari 4+ and Chrome.
If it doesn’t work in any of those, it’s a bug so please report it. Just before you do, please make sure that it’s not because the browser doesn’t support a CSS3 feature at all, even with a prefix.
In older browsers like IE8, nothing will break, just properties won’t get prefixed. Which wouldn’t be useful anyway as IE8 doesn’t support much CSS3 ;)
Test the prefixing that PrefixFree would do for this browser, by writing some CSS below:
Not really. Properties that already have a prefix won’t be altered. So, if you want to specify different behavior for a certain engine just use already prefixed properties.
Firefox (and IE?) natively support local XHR, so PrefixFree will work fine locally with them.
To enable local XHR for Chrome, you need to run it with the flag --allow-file-access-from-files.
To enable local XHR for Opera, you have to go to opera:config#UserPrefs|AllowFileXMLHttpRequest, check that option and Save.
A server side script would need to add all prefixes, making the size of the CSS file considerably larger. Also, it should maintain a list of features that need prefixes, or add them all and unnecessarily bloat the stylesheet. Prefixfree automatically detects what needs a prefix and what doesn’t.
Also, a common argument against doing this on the client side, is that it makes the design rely on JavaScript. However, that is completely false: If JS is disabled, only some of the CSS3 won’t show. But if your design relies on CSS3 to be functional, you have bigger problems bro.
But every solution has its own pros and cons. If you would feel more comfortable with a server-side script, use that. Remember: nobody forced you to use PrefixFree. KTHXBAI ☺
Extra code on top of PrefixFree that makes it more flexible, integrates it with different APIs etc
Originally a part of PrefixFree, it’s now a separate plugin. It makes PrefixFree take care of:
<link> and <style> added to the document afterwardsstyle attribute added to the document afterwardsstyle attribute changes through setAttribute() (except in Webkit)element.style.transform = 'rotate(10deg)';
style attribute modifications will not work in Webkitelement.style.transform = 'rotate(5deg)';will not work in Chrome (reading will)
Get the Dynamic DOM plugin now:
A tiny plugin (I didn’t even bother minifying it as it’s so small) that lets you set/get unprefixed CSS properties through jQuery's .css method.
Get the jQuery plugin now: