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?
6 Answers
The best way to install package for viewing coloured less syntax in sublime text is following this link:
https://sublime.wbond.net/installation#st2
That is because here there are instruction on how to do in case the command line written in the precedent answer doesn't work. There are also two different command lines for different versions of Sublime Text.
After package is installed you will see the LESS category in the View>Syntax menu option.
To me it helped a lot. Hope it works for you too!
You can install the package manager by using copying the following code and pasting it in the sublime text console (view -> show console) :
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
When it's installed you press ctrl+shift+p, write install then click on install package. On the screen that comes up write sass then click on the sass syntax package. When that's finished just open your scss file, press ctrl+shift+p then write sass and click on "set syntax: sass"
If Package Control is not installed on your Sublime Text you can install package manually.
To install LESS package manually follow this procedure:
- Download the LESS package : https://github.com/danro/LESS-sublime/archive/master.zip
- Unzip the archive package
- From Sublime Text go to Preferences → Browse Packages...
- Copy/paste the package folder into the new window just opened
- Restart Sublime Text
- Open a
.lessfile - Go to View → Syntax → Open all with current extension as... → Less
To install SCSS package you must do the same procedure.
SCSS package direct download : https://github.com/MarioRicalde/SCSS.tmbundle/archive/master.zip
Happy coding!
