首页 > 解决方案 > SASS 语法错误:应为数字。得到:计算()

问题描述

当我在浏览器中使用这个 CSS 时,它工作正常

background: linear-gradient(to bottom right, transparent calc(50% - 1px), red 50%, transparent calc(50% + 1px) );

但是当我在 SASS 中使用它时,

background: linear-gradient(to bottom right, transparent calc(50% - 1px), red 50%, transparent calc(50% + 1px) )

我收到一个错误:SASS Syntax error: Expected a Number. Got: calc(50% + 1px) 我错过了什么?

标签: csssass

解决方案


推荐阅读