css - SASS 新手 - 未编译

标签 css sass

刚刚决定学习 SASS,非常简单的东西,只是一个非常基本的文件无法编译。

这实际上是基本的:

$test: #ffffff;

命令:

sass test.sass

错误消息:

error: expected "
".
$test:#ffffff;
             ^
  test.sass 1:14  root stylesheet

我不知道预期的“-预期在哪里?”是什么意思?

最佳答案

请将扩展名 test.sass 更改为 test.scss。你可以走了。 100% :)

根据 sass-lang.com .

There are two syntaxes available for Sass. The first, known as SCSS (Sassy CSS) and used throughout this reference, is an extension of the syntax of CSS. This means that every valid CSS stylesheet is a valid SCSS file with the same meaning. In addition, SCSS understands most CSS hacks and vendor-specific syntax, such as IE's old filter syntax. This syntax is enhanced with the Sass features described below. Files using this syntax have the .scss extension.

The second and older syntax, known as the indented syntax (or sometimes just "Sass"), provides a more concise way of writing CSS. It uses indentation rather than brackets to indicate nesting of selectors, and newlines rather than semicolons to separate properties. Some people find this to be easier to read and quicker to write than SCSS. The indented syntax has all the same features, although some of them have slightly different syntax; this is described in the indented syntax reference. Files using this syntax have the .sass extension.

关于css - SASS 新手 - 未编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50392991/

相关文章:

javascript - jQuery文件上传预览/删除图片

javascript - 根据可见系列更改饼图标题

html - 如何使页脚贴在底部并将正文内容从页眉拉伸(stretch)到页脚

javascript - 新生成元素的子元素的事件监听器不起作用

javascript - Webpack、Sass - 超出最大调用堆栈大小

html - 使链接 <a></an> 可根据内容调整

html - 我表单上的 CSS 样式在 Firefox 上不起作用

css - Rails App 上的自定义字体未加载

css - 加载 SASS 样式表时出错

html - 为什么不是 (xs : 0, sm : 576px, md : 768px, lg : 992px, xl : 1200px) a valid CSS value in Sassmeister?