IE11 中的 CSS hsl 计算错误

标签 css internet-explorer-11 calc hsl

IE11 似乎不计算 hsl(31, 86, calc(54% - 10%)),但所有其他浏览器都计算。

我想在 hsl 值中使用 calc 和 CSS 自定义属性(css 变量)。 而且我不想使用 SASS 函数。 (我使用这个 polyfill 来为 IE11 使用 css 变量。 https://github.com/jhildenbiddle/css-vars-ponyfill )

:root{
  --accent-color-h: 31;
  --accent-color-s: 86%;
  --accent-color-l: 54%;
}
.darken .accent-color{
  background-color: hsl(var(--accent-color-h), var(--accent-color-s), calc(var(--accent-color-l) - 10%));
  }

最佳答案

IE does not support calc() on color functions. Example: color: hsl(calc(60 * 2), 100%, 50%).

来源:https://caniuse.com/#feat=calc

在此上下文中,您需要抓取对 calc() 的要求

关于IE11 中的 CSS hsl 计算错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57820715/

相关文章:

css - 移动显示 :Block link text to the bottom of a div

javascript - 如何在屏幕上垂直居中对齐具有 100% 宽度和定义的 padding-bottom 的 div?

html - 如何用计算函数填空?

java - 使用 Java 更改计算器

jquery - 用jquery计算动态添加的行并构建总计一列

javascript - Velocity.js 在动画后清除默认值

html - 通过 Controller CSS 访问 View 时不起作用

javascript - IE 11 中的模糊文本

css - IE10、IE11 中的跨浏览器 css 渐变

javascript - 加载器在 IE 和 Chrome 中不工作