When using both webkit filters "blur" and "invert", only blur works. And if "blur" is removed "invert" works.
Also only Chrome and Opera are responding to the code.
Is there a way to make this work for recent IE and Firefox versions?
body {
-webkit-filter: invert(100%);
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);
}
You could use
svg
'sforeignObject
element to import the entirebody
's content into ansvg
element and then apply thefilter
s on theforeignObject
which will apply thefilter
s on the entirebody
.Browser support for
svg
filters vs CSS filters.Demo on CodePen
If you want to apply the
filter
on an event, you could remove thefilter
attribute from theforeignObject
element initially and apply thefilter
using JavaScript this way.