Edge evaluates @supports(mask) as true when mask isn't supported

一曲冷凌霜 提交于 2021-02-20 16:24:39

问题


Edge doesn't support CSS mask, yet the @supports statement below is calculating as true and the enclosed styles are being applied in Edge. What can I put into the @supports argument to get Edge to ignore the conditional block

body {
  font-family: monospaced;
  color: red;
  background-image: url(test.png);
}

@supports(mask: url("")) {
  body {
    background-color: #eee;
    font-family: sans-serif;
    color: rebeccapurple;
    mask: url(test.svg);
    mask-size: cover;
  }
}
<h3>This should be red and mono-spaced in Edge</h3>

回答1:


According to the Edge API docs, mask is supported, but since I'm ultimately just looking for support of a mask image, I can do:

@supports(mask-image: url("")) {
  body {
    …
    mask-image: url(test.svg);
    …
  }
}

Cleaner and more specific.

The docs mention that a maskImage style property is supported, but I can't get that to work.



来源:https://stackoverflow.com/questions/49231866/edge-evaluates-supportsmask-as-true-when-mask-isnt-supported

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!