D
D
Daniel2542014-07-27 18:41:18
Sass
Daniel254, 2014-07-27 18:41:18

How to use in Sublime 2 CSScomb 3 for SASS?

Recently released a new, 3rd version of CSScomb. The developers say there is sass support.
Tell me, has anyone managed to use CSScomb in Sublime 2 for sass projects? If so, how?
Node is installed, .csscomb.json is there, sorting is fine in regular css files, but nothing happens in sass. Errors don't pop up

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MoranXP, 2014-10-06
@MoranXP

There really is support.
First you need to install syntax support for SCSS and SASS (depending on what you use)
Next, go to Sublime Text -> Preferences -> Browse Packages and open the Packages/CSScomb/CSScomb.py file
We are looking for the get_syntax (self) method there and look for the condition for SASS, if it is not there, add:

if self.is_sass():
  return 'sass'

Similarly for SCSS:
if self.is_scss():
  return 'scss'

We also check the presence of methods
if they are not there, add:
def is_sass(self):
        return self.view.settings().get('syntax').endswith('/Sass.tmLanguage')

and
def is_scss(self):
       return self.view.settings().get('syntax').endswith('/SCSS.tmLanguage')

We save the file.
After that everything should work.
And do not forget to choose the correct syntax for files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question