Reputation: 6987
CSS.supports() in Edge returns incorrectly for properties that are apparently supported.
console.log(CSS.supports("( filter: blur(20px) )"));
console.log(CSS.supports("filter", "blur(20px)"));
console.log(CSS.supports("( backdrop-filter: blur(20px) )"));
console.log(CSS.supports("backdrop-filter", "blur(20px)"));
Logs:
true true false false
The last two are incorrect, as backdrop-filter
does actually work in Edge.
However this works as expected:
@supports (backdrop-filter: blur(20px)) {
body { border: 20px solid red; }
}
Am I missing something, or is CSS.supports broken in Edge? And how can I detect support for backdrop-filter
?
Upvotes: 1
Views: 178
Reputation: 723468
Microsoft Edge does not support the unprefixed backdrop-filter
property; it only supports -webkit-backdrop-filter
.
If your CSS works, it's either being prefixed at runtime by a script like -prefix-free (although -prefix-free itself is not known to support backdrop-filter
), or postprocessed by something like Autoprefixer, silently adding the -webkit-
prefix for you.
Upvotes: 2
Reputation: 11335
As per the documentation below, Currently CSS Backdrop Filter only supported with the -webkit- prefix (not -ms-) in MS Edge browser.
Because of that reason, It returns false.
Upvotes: 0