How to set scss syntax in Sublime 3?

CssSassSublimetext3SublimetextSyntax Highlighting

Css Problem Overview


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 + P and type sass or scss I get no option. I had to set syntax to CSS.

Is there any way to set syntax to SCSS in Sublime 3?

Css Solutions


Solution 1 - Css

press CTRL + Shift + P in Submile Text below popup opens

enter image description here

Click on the Package Control: Install Package.which will open the below popup. Type SCSS in the search box. Look for exactly: SCSS (it may not be the first thing that comes up) and click on it.

enter image description here

again press CTRL + Shift + P and search for SCSS and click on the Set Syntax: SCSS. that it your scss files will be colored accordingly

enter image description here

Solution 2 - Css

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.

The 'Sass' package contains both Sass and SCSS, and is much more complete for SCSS than the package just called 'SCSS'.

Steps to install:

  1. CTRL+SHIFT+P (Mac: COMMAND+SHIFT+P)
  2. Type 'Package Control: Install package' and press Enter. Wait several seconds
  3. Type 'Sass', ensure the selected item is just 'Sass', and press Enter.
  4. You'll see installation status in the status bar at the bottom of the app. When finished installing:
  5. CTRL+SHIFT+P again
  6. Type 'Set syntax: SCSS' and press Enter

Solution 3 - Css

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:

  • Open View -> Syntax -> Open all with current extension as...
  • Select Sass -> SCSS

Credit: http://joncaveman.com/2015/08/11/sublime-text-3-default-syntax-highlighting-for-file-types/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser31782View Question on Stackoverflow
Solution 1 - CssyasaruiView Answer on Stackoverflow
Solution 2 - CssjameslolView Answer on Stackoverflow
Solution 3 - CssRyan WhealeView Answer on Stackoverflow