8000 csscomb not working for .scss files · Issue #7 · csscomb/sublime-csscomb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

csscomb not working for .scss files #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
entozoon opened this issue Feb 24, 2014 · 30 comments
Closed

csscomb not working for .scss files #7

entozoon opened this issue Feb 24, 2014 · 30 comments

Comments

@entozoon
Copy link

I've installed csscomb js into sublime 3 and ctrl+shift+c (or tools>run csscomb js) works fine for .css files but seemingly does nothing (and no console message) within an .scss file.

I know it should work fine with sass because I've used the previous versions with no problems.
It's as if the package only loads for .css files and not others. I wouldn't mind if it loaded for every file type.

Thanks in advance.

@tonyganch
Copy link
Member

Does ST detects file syntax correctly?
If you paste view.settings().get('syntax') in console, what is the response?

@entozoon
Copy link
Author
>>> view.settings().get('syntax')
'Packages/Syntax Highlighting for Sass/Syntaxes/SCSS.tmLanguage'

(whatever that means :P )

tonyganch added a commit that referenced this issue Feb 26, 2014
Check only syntax file name, regardless parent directory.
See #7.
@tonyganch
Copy link
Member

Thanks, that helped a lot :)
I've published a fix that should help.
I guess it'll take some time for it to appear at Package Control, but you can always install the plugin from GitHub.

@entozoon
Copy link
Author

Fantastic, glad to be of service to such an epic tool!

@paramburu
Copy link

Sorry but I belive this wasn't fixed. I'm getting the following error while trying to sort SCSS files:

Error: Parsing error at undefined: Please check the validity of the CSS block starting from the line #12
    at Object.Comb.processString (/Users/*/Library/Application Support/Sublime Text 3/Packages/sublime-csscomb/node_modules/csscomb/lib/csscomb.js:205:19)
    at Socket.<anonymous> (/Users/*/Library/Application Support/Sublime Text 3/Packages/sublime-csscomb/csscomb.js:23:37)
    at Socket.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

It can be a problem with the csscomb itself so please let me know if I should report it to the other tracker. I think the following block might be the problem although is a valid scss block:

    @media #{$medium-up} {
        width: $medium-up-width;
    }

@tonyganch
Copy link
Member

@paramburu, interpolated variables, yes.
This error will be fixed once CSScomb 3.0 is out: csscomb/csscomb.js#214

@paramburu
Copy link

Thanks. But, may I ask you why is it that the web interface doesn't complaint?

http://csscomb.com/online/

@tonyganch
Copy link
Member

@paramburu, because the website is soooo outdated and "Online sorting" still uses php version :)
We'll update it with v3.0.

@uxleo-com
Copy link

For me the problem persists, no msg in the console when I run CSScomb on sass. Syntax is 'Packages/Syntax Highlighting for Sass/Syntaxes/SCSS.tmLanguage', but fixing it, as suggested in d30446d doesn't help.

@tombpain
Copy link

I am also having issues with SCSS. Nothing happens, no exceptions in the console, just doesn't do anything. Works fine with css.

@DavidBachmann
Copy link

Was having the same problem as tombpain. The reason was that my Sublime syntax was set to Sass instead of SCSS. Installing the SCSS syntax solved the problem.

@tombpain
Copy link

@DavidBachmann Fantastic, thanks, worked perfectly.

@cmalven
Copy link
cmalven commented Aug 23, 2014

Suddenly CSS comb stopped working for me, too. I'm using the SCSS syntax for the file. CSS comb doesn't error, but it also doesn't reorder properties. It just unindents the selected block.

@MarcelRobitaille
Copy link

For all those getting this error:

Step 1: Open Packages/CSScomb/CSScomb.py
Step 2: Go near bottom of file
Step 3: Make sure you have both

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

and

def is_sass(self):
        return self.view.settings().get('syntax').endswith('/Sass.tmLanguage')

Step 4: Under "def get_syntax(self):", add:

if self.is_sass():
        return 'scss'
CSScomb should now work in both Sass and SCSS syntaxes

@felipeduardo
Copy link

worked very well with sass / SCSS, but now ...

  .panel
{
    position: relative;

    overflow: hidden;

    height: 205px;
}

@yumyo
Copy link
yumyo commented Oct 29, 2014

@felipeduardo same results for me too

@ghost ghost mentioned this issue Oct 29, 2014
@chernetsov0
Copy link
Contributor

Can confirm that @Marcel-Robitaille fix works and I like Sass highlighting a lot more than SCSS one. So should be fixed IMO. Installed CSScomb today from Package Control but still experience this.

@dimaip
Copy link
dimaip commented Jan 13, 2015

@felipeduardo had the same issue, the problem is with weird defaults, should be: "space-before-opening-brace": " ",

@glencampbell
Copy link

No fix for this? Followed steps above and am getting no sorting at all; just getting the spacing issue @felipeduardo is getting. Would be great to see this getting sorted – have been having these issues for a long time now

@glencampbell
Copy link

Bump! I miss CSS Comb :-(

@abacaj
Copy link
abacaj commented Apr 10, 2015

bump.

@adonaicandido
Copy link

bump

@ixley
Copy link
ixley commented Jun 5, 2015

+1

@ixley
Copy link
ixley commented Jun 8, 2015

I'm not sure if this was it, but building out my config file with explicit sort order seemed to fix things for me. I'm guessing that relying on the default settings for this just wasn't working with sass/scss.

@ixley
Copy link
ixley commented Jun 8, 2015

I've now gotten it to process most of my scss files fine, but it's throwing an error ("Please check the validity...") for this:

@for $i from 0 through 2 {
  .pie-slice._#{$i} path,
  .dc-legend .dc-legend-item:nth-child(#{$i + 1}) rect {
    fill: darken($teal, $i * 10);
  }
}

It appears to be choking on interpolating #{$i + 1} – so if I remove the +1 it will complete without errors, but I'm not sure what it doesn't like about this, since it seems to deal with this sort of interpolation fine in other places.

@paulmelero
Copy link

@ixley, I think you were missing a braket there:

@for $i from 0 through 2 {
  .pie-slice._#{$i} .path,
  .dc-legend .dc-legend-item:nth-child(#{$i + 1}) rect {
        fill: darken($teal, $i * 10);
  }
}

@ixley
Copy link
ixley commented Jul 7, 2015

@gangsthub Thanks for catching that –I'm not sure why that bracket didn't get pasted in above (I've updated the snippet in my comment), but it is correctly formed and not the cause of the error. Like I mentioned, it appears to not like something about that specific interpolation string with the +1.

@vh22
Copy link
vh22 commented Dec 3, 2015

font: 400 #{$base-font-size + 3px}/#{$base-btn-line-height} $base-font-family;
The same error: "Please check the validity of the block starting from line #10"

@rbelling
Copy link
rbelling commented Dec 4, 2015

having the same problem here... gonzales is failing while parsing the interpolated valuse in this snippet:

$diff-size: strip-unit($max-size - $min-size); //e.g. 13
$diff-range: $upper-range - $lower-range;
#{$property}: calc(#{$min-size} + #{$diff-size} * ((100vw - #{$lower-range}px) / #{$diff-range}));

@include width-under($lower-range) {
    #{$property}: $min-size;
}
@include width-over($upper-range) {
    #{$property}: $max-size;
}

@arvi
Copy link
arvi commented Jun 3, 2016

I had the same issue. What worked for me is installing SCSS Sublime Package before running csscomb and adding

{
    "custom_sort_order": true
}

Package Settins > CSScomb > Settings - User

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0