CSS 如何在 Sublime 3 中设置 scss 语法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42159810/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to set scss syntax in Sublime 3?
提问by user31782
I'm using Sublime 3 editor. When I open a SCSS file it shows many red characters because it misjudged the syntax. When I press CTRL+ Shift+ Pand type sass
or scss
I get no option. I had to set syntax to CSS.
我正在使用 Sublime 3 编辑器。当我打开一个 SCSS 文件时,它显示了许多红色字符,因为它错误地判断了语法。当我按CTRL+ Shift+P并输入sass
或scss
我没有选项时。我必须将语法设置为 CSS。
Is there any way to set syntax to SCSS in Sublime 3?
有没有办法在 Sublime 3 中将语法设置为 SCSS?
回答by codegeek
press CTRL+ Shift+ Pin Submile Text below popup opens
在弹出窗口下方的 Submile Text 中按CTRL+ Shift+P
Click on the Package Control: Install Package.which will open the below popup.type SCSSin the search box.the first suggestion will be SCSS(It is not highlighted in the below image) and click on it.
单击Package Control: Install Package 。这将打开下面的弹出窗口。在搜索框中键入SCSS。第一个建议将是SCSS(下图中未突出显示)并单击它。
again press CTRL+ Shift+ Pand search for SCSS and click on the Set Syntax: SCSS. that it your scss files will be colored accordingly
再次按CTRL+ Shift+P并搜索 SCSS 并单击Set Syntax: SCSS。您的 scss 文件将相应地着色
回答by jameslol
There are two very popular packages: 'Sass', and 'SCSS'. I started with the 'SCSS' package, given that codegeek's 72+ answer suggests it, but I found that a large amount of my valid SCSS was just white.
有两个非常流行的软件包:“Sass”和“SCSS”。我从“SCSS”包开始,考虑到 codegeek 的 72+ 答案表明它,但我发现我的大量有效 SCSS 只是白色的。
The 'Sass'package contains both Sass and SCSS, and is much more complete for SCSS than the package just called 'SCSS'.
在“萨斯”包包括萨斯和SCSS,是SCSS更完整的不仅仅是所谓的“SCSS”包。
Steps to install:
安装步骤:
- CTRL+SHIFT+P(Mac: COMMAND+SHIFT+P)
- Type '
Package Control: Install package
' and press Enter. Wait several seconds - Type '
Sass
', ensure the selected item is just 'Sass
', and press Enter. - You'll see installation status in the status bar at the bottom of the app. When finished installing:
- CTRL+SHIFT+Pagain
- Type '
Set syntax: SCSS
' and press Enter
- CTRL+ SHIFT+ P(Mac: COMMAND+ SHIFT+ P)
- 键入“
Package Control: Install package
”并按Enter。等待几秒钟 - 键入“
Sass
”,确保所选项目只是“Sass
”,然后按Enter。 - 您将在应用底部的状态栏中看到安装状态。安装完成后:
- CTRL+ SHIFT+P再次
- 输入“
Set syntax: SCSS
”并按Enter
回答by Ryan Wheale
If you have the Sass extension installed (which supports both SASS and SCSS) and you want all .scss
files to open with the newer SCSS syntax highlighting rather than the older SASS, then do the following:
如果您安装了 Sass 扩展(支持 SASS 和 SCSS),并且您希望所有.scss
文件都使用较新的 SCSS 语法突出显示而不是旧的 SASS 来打开,请执行以下操作:
- Open View -> Syntax -> Open all with current extension as...
- Select Sass -> SCSS
- 打开视图 -> 语法 -> 以当前扩展名打开所有...
- 选择Sass -> SCSS
Credit: http://joncaveman.com/2015/08/11/sublime-text-3-default-syntax-highlighting-for-file-types/
信用:http: //joncaveman.com/2015/08/11/sublime-text-3-default-syntax-highlighting-for-file-types/