Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2: How to get scss and Less files to have color?

I'm using Sublime Text 2 and the css.scss and css.less files are in all white text - the comments, brackets, syntax - everything. If I look at my regular css files, they have color to differentiate all of the above. Has anyone else dealt with this? Is this some bug I'm getting? How could I add my own color or take the same settings from the regular css file and add it to the less and scss one's?

like image 765
Jryl Avatar asked Jun 08 '13 10:06

Jryl


People also ask

Does Sublime Text support SCSS?

Unfortunately, by default, Sublime Text is incompatible with SASS/SCSS syntax.

Why is my code in Sublime Text not colored?

Click the relevant language and the Sublime will do the coloring according to your selection. Show activity on this post. If you are just opening new files and pasting text in, the default syntax is "Plain Text", thus no highlighting.


2 Answers

You can set the syntax for any specific extension. Please see this:

http://www.codechewing.com/library/set-default-syntax-highlight-for-different-filetypes-sublime-text/

Open the corresponding file with .scss/.less extension. From the menu at the top, goto View > Syntax > [Optional: Open all with current extension as...] > CSS

enter image description here

like image 92
Chubby Boy Avatar answered Sep 21 '22 15:09

Chubby Boy


  1. In SublimeText Preferences > Package Control.

  2. Select "Package Control:Install Package".

  3. Now type "LESS" in the box. Click on first option which appears.

  4. Restart Sublime.

  5. Open the LESS file

  6. View > Syntax. Select LESS

Same follows for SASS even

like image 37
Puneet Mahendra Avatar answered Sep 20 '22 15:09

Puneet Mahendra