javascript - 使用 node-sass 编译 CSS 时格式无效
问题描述
使我的页面响应时出现错误。我正在使用@mixin 来实现这一点。
@mixin mediaSm{
@mixin screen and (max-width:768px) {
@content;
}
}
@mixin mediaMd{
@mixin screen and (max-width:500px) {
@content;
}
}
@mixin mediaLg{
@mixin screen (min-width:769px) and (max-width:1170px) {
@content;
}
}
@mixin mediaSm{
@mixin screen and (min-width:500px) {
@content;
}
}
我收到一条错误消息,提示格式错误,应该在 'and' 之后有 '{'。我使用的是 Ubuntu,但相同的代码在 Windows 10 中没有显示出某种错误。
{ "status": 1, "file": "/opt/lampp/htdocs/my_portfolio/scss/_config.scss", "line": 34,
"column": 10, "message": "Invalid CSS after \" @mixin screen\": 预期 \"{\", 是 \"and (max-width:768p\"", "formatted": "Error: Invalid CSS after \" @mixin screen\": 预期 \"{\ ", 是 \"and (max-width:768p\"\n 在 scss/_config.scss 的第 34 行\n 从 scss/main.scss 的第 1 行\n>> @mixin 屏幕和 (max-width:768px ){\n\n ---------^\n" }
解决方案
推荐阅读
- rust - gtk-rs app 给出警告“您的应用程序没有实现 g_application_activate() 并且没有连接到 'activate' 信号的处理程序”
- python - 使用 Tkinter 时无法更新分数
- ruby-on-rails - 从 ActiveStorage+DirectUpload 中删除未使用的文件
- node.js - 找不到模块“../encodings”
- javascript - 从 JSON 对象角度 10 将值设置为嵌套表单组
- java - java - 如何使用基于此身份的递归计算Java中的幂
- ios - -[NSConcreteNotification count]:无法识别的选择器发送到实例 0x2816dd380
- python - 即使在安装包后在 Conda 环境中获取 ModuleNotFoundError
- powershell - PowerShell 嵌套 ForEach 循环的问题
- json - 在 VueJS 中从 JSON 水平制作表格