css - Sass 错误:“...0, 0, -5deg); }”之后的 CSS 无效:预期 1 个选择器或规则,为“{”
问题描述
编译时抛出 Sass 错误:
@keyframes flipInX
from
transform: perspective(400px) rotate3d(1, 0, 0, 90deg)
animation-timing-function: ease-in
opacity: 0
40%
transform: perspective(400px) rotate3d(1, 0, 0, -20deg)
animation-timing-function: ease-in
60%
opacity: 1
transform: perspective(400px) rotate3d(1, 0, 0, 10deg)
80%
transform: perspective(400px) rotate3d(1, 0, 0, -5deg)
to
transform: perspective(400px)
错误指向这一行:
...
80%
变换:透视(400px)旋转3d(1、0、0、-5度)
to
...
此错误过去在不同的地方抛出,并在切换行或重新键入选项卡和/或新行键入后消失。这似乎是一个错误,这很烦人。我该如何解决这个问题?
PS如果可以提供帮助,我正在使用Sublime Text 3...
解决方案
在我看来这是你的缩进。Sass 有一个缩进语法——缩进等于 using {}
。
在您的示例中,缺少缩进,因此无法正确编译代码。
将您的代码复制到 CodePen 并给它缩进正在为我修复错误:
@keyframes flipInX
from
transform: perspective(400px) rotate3d(1, 0, 0, 90deg)
animation-timing-function: ease-in
opacity: 0
40%
transform: perspective(400px) rotate3d(1, 0, 0, -20deg)
animation-timing-function: ease-in
60%
opacity: 1
transform: perspective(400px) rotate3d(1, 0, 0, 10deg)
80%
transform: perspective(400px) rotate3d(1, 0, 0, -5deg)
to
transform: perspective(400px)
缩进由两个空格组成,没有制表符。
推荐阅读
- heroku - 使用 Dockerfile 在 Heroku 上部署 ApacheNifi
- c# - 复合键和外键 EF Core 的关系
- vpn - How to connect to vpn from the another subnet with the same external IP
- android - 单击操作栏菜单选项项时如何打开 EditText 视图
- machine-learning - 如果验证没有收敛,我的模型是否过度拟合?
- python - 用于 NifTi 文件 Python 的 OpenCv
- unit-testing - 使用 Spock 模拟 Java 8 方法
- c# - PowerShell UI 自动化库 - 如何设置超时
- java - 如何使用不在接口中的成员强制转换为多态类型
- mongodb - 如何确保插入后文档中的值仍然相同