# CSS-Filters-Polyfill **Repository Path**: mirrors_leecade/CSS-Filters-Polyfill ## Basic Information - **Project Name**: CSS-Filters-Polyfill - **Description**: This polyfill takes the official CSS filters syntax and translates it to the different equivalent techniques that the browsers know for those effects - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2026-02-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Polyfilter - a CSS Filters Polyfill =================================== This polyfill takes the official CSS filters syntax and translates it to the different equivalent techniques that the browsers know for those effects: * Just prefixing for the WebKit-Browsers * Translating to SVG-filters for Firefox * Translating to DirectX-filters for IE 6-9 For instance, this allows you to assign a property like `filter: blur(10px);` in your stylesheets and the polyfill will take care that it works in as many browsers as possible. ##Supported Filters## * grayscale* * sepia* * blur * invert* * brightness * drop-shadow Have a look at [this overview](http://www.der-schepp.de/css-filters-polyfill/examples/static-vs-animated/static.html). \* _the IEs only support 0% or 100% values_ ##Supported Browsers## Currently the polyfill is able to support * Chrome 20+, * Safari 6+, * Yandex 1+, * Firefox 4+ and * IE 6 - 9 on desktop (IE 6 & 7 slightly degraded), and * iOS 6+ Safari/Chrome * Firefox 4+ on Mobile (albeit slow) and * IE on Windows Phone 7, which just supports grayscale. Not supported are IE 10(!), Opera and Opera Mini, as well as Chrome on Android (they didn't turn on CSS filter effects there as of yet). ###A word regarding IE 10### Why is IE 6 - 9 supported, but not IE 10? Well, since Microsoft decided to switch sides and to now follow standards, they killed their old proprietary filters in IE 10 which I rely on for emulation. On the other hand they introduced the real CSS filters, but those are limited to a usage inside SVGs. They cannot be applied to HTML-elements. This is why we are left at the end with no hook/support at all :( If CSS filters are *super important* for you in IE 10, meaning more important than other improvements of the platform, you could kick IE 10 back into IE 9 mode where all of the proprietary filters are turned back on. You can do this by setting the following `` in the `
`: ```html ``` **But know that if you so you also lose all the other advancements of IE 10 over IE 9**! And that's a lot, namely being: HTML5 forms, Application Cache, Web Sockets, Web Workers, History, Drag and Drop, XHR 2, File API, IndexedDB, Page Visibility, DeviceOrientation, Touch, Pointer and Gesture APIs, requestAnimationFrame, CSS Animations, CSS Transitions, CSS 3D transforms, CSS Gradients, CSS Exclusions, CSS FlexBox, CSS Grid Layout, CSS Multi-column layout and finally CSS Regions. That's a though call, I know. ###And what about Opera?### Opera offers none of the hooks I could use to simulate CSS filter effects. So it is basically up to you people requesting support for CSS filter effects from Opera. But I might guess that you will remain unheard since Opera is very mobile and low-end device focused and filters hurt performance a lot. So it could take its fair amount of time to convince them. Anyway, as far as I am concerned, I took care that once Opera supports filters, even when only prefixed, this polyfill will pick up support automagically. ##Setup## First create a ` ``` This is important for the IEs. Then you link `cssParser.js` and `css-filters-polyfill.js` from the polyfill library. ```html ``` In an ideal world you should minify and concatenate both of them together with your other JavaScript. If you don't want your page to get blocked by script-loading you put the scripts way down before the closing ``. This might lead to some flickering of the filter effects during loading. If you can't live with the short flickering, put the scripts in the `` of the page. Then it'll be gone, but your page will load slower. You decide. ##Usage## ###Declarative assignment### This polyfill supports filter declarations in embedded (`