brackets-beautify icon indicating copy to clipboard operation
brackets-beautify copied to clipboard

SCSS support

Open mrmckeb opened this issue 11 years ago • 30 comments

First, great plugin, really.

I've just started using this plugin, and would love SCSS support in Beautify. It's close already, I've just noted a few small bugs.

https://github.com/jasonsanjose/brackets-sass

mrmckeb avatar Apr 22 '14 08:04 mrmckeb

I was going to try to do this using node and calling the ruby sass-convert program(which will do formatting also) but it seems this guy wrote his own formatter in javascript.

https://github.com/ysakmrkm/grunt-sass-format/blob/master/tasks/sass-format.coffee

I still need to test it but it looks promising.

drewhamlett avatar Apr 29 '14 01:04 drewhamlett

On second thought it looks like it's just a format checker, sadly. Looked like it was actually doing some formatting at first.

drewhamlett avatar Apr 29 '14 01:04 drewhamlett

No pressure, your work to date has been amazing and makes life a little less stressful.

mrmckeb avatar Apr 29 '14 08:04 mrmckeb

Haha. Thanks.

Please check out the Sass formatting. https://github.com/drewhjava/brackets-beautify/tree/sass-format

You'll need to download this branch and replace the extension you currently have. Please look at Readme to see how to provide the SASS executable path. Let me know if you have any issues.

drewhamlett avatar Apr 29 '14 15:04 drewhamlett

Thanks, I'll have a play and let you know.

mrmckeb avatar May 01 '14 12:05 mrmckeb

Hey, first off, great plugin! Has helped a lot with crazy amounts of css. I just went to add support scss as per your guide and ran into an error.

Now in your case, your using a ruby package manager, but I'm just using the default location. So I got this from the terminal

/usr/bin/sass-convert

and entered this as path in my preferences file.

"beautify.sassConvertPath": "/usr/bin/sass-convert"

But got an error even after restarting Brackets. Any ideas?

mhartington avatar May 09 '14 18:05 mhartington

Hi, what was the error you got? Also you can install the extension from the Brackets manager now. Don't pull it from the repository.

drewhamlett avatar May 09 '14 19:05 drewhamlett

An error occured formatting the SASS file

mhartington avatar May 09 '14 19:05 mhartington

Pretty obscure so I'm not sure what the issue could be, or where it could be.

mhartington avatar May 09 '14 20:05 mhartington

I get the same error on a Windows machine..

"beautify.sassConvertPath": "C:\\Ruby193\\bin\\sass-convert"

Not doing double backslash doesn't help either. The thing that sucks the most is, that everytime I save a scss file I now get 2 very slow dialog boxes.

Edit: Well, I just tried one more scenario and it worked...

"beautify.sassConvertPath": "C:\\Ruby193\\bin\\sass-convert.bat"

maartenla avatar May 20 '14 07:05 maartenla

Hi @mhartington have you had any luck with this? I tried on a fresh formatted machine and it worked with standard ruby(OSX Mavericks). No rbenv.

@mlakerveld Thank you for your persistence in getting it working!

drewhamlett avatar May 20 '14 11:05 drewhamlett

@drewhjava unfortunately not, I even started with a fresh install of brackets but it did not resolve my issue. Still got that error message

mhartington avatar May 21 '14 15:05 mhartington

Hey @drewhjava, sorry to bring this up again, but I've still haven't been able to resolve this.

What I have now in my preference file is this

"beautify.sassConvertPath": "/Users/mhartington/usr/bin/sass-convert"

But I still get that error. Would you be able to share the path that you had on the Mac without rmv?

mhartington avatar Jun 20 '14 01:06 mhartington

Hello @drewhjava, I do have the same problem as @mhartington. I just get a Javascript Alert - file:/// An error has occurred while formatting SASS. I have tried everything possible but nothing seems to fix the problem.

loicsans avatar Jun 26 '14 07:06 loicsans

Hey guys, I'm looking into this.

@loicsans Are you using Windows?

If so have you tried this.

"beautify.sassConvertPath": "C:\\Ruby193\\bin\\sass-convert.bat"

drewhamlett avatar Jun 26 '14 23:06 drewhamlett

@drewhjava, thanks for the swift reply. I'm using Mac OS X. I did try different paths, installing and reinstalling ruby and SASS. Nothing has worked so far.

loicsans avatar Jun 27 '14 09:06 loicsans

I have same problem with formatting. Some days ago it stoped work and got error: "An error has occurred while formatting SASS"

Windows 7 In settings I tried "beautify.sassConvertPath": "C:\\Ruby200\\bin\\sass-convert.bat" and "beautify.sassConvertPath": "C:\\Ruby200\\bin\\sass-convert" did not helped

tehkonst avatar Jun 30 '14 18:06 tehkonst

I found answer. Seems formatting doesn't work when working directory has spaces beginning from root.

tehkonst avatar Jun 30 '14 18:06 tehkonst

Hi Guys, I'm also having this same issue.

I have Sass 3.3.9 (Maptastic Maple) installed.

I've got the following in my preferences file: "beautify.sassConvertPath": "/Users/Jeremy/usr/bin/sass-convert but I get the following error when trying to run the plugin:

JavaScript Alert - file:/// An error occurred formatting the SASS file

Here's a stupid question. Should this work with a SCSS file, or only SASS file?

jmillspaysbills avatar Jul 02 '14 20:07 jmillspaysbills

Hi there, how do I disable this feature for scss file? In case I don't want beautify handles compile staff for me. Thanks!

unknwon avatar Jul 03 '14 04:07 unknwon

I'm getting the same error message when saving a scss file: JavaScript Alert - file:/// An error occured formatting the SASS file

My brackets.json has got the recommended path, too: "beautify.sassConvertPath": "C:\\Ruby200\\bin\\sass-convert.bat"

Update: Same issue on my Mac! Tried different paths as well (according to the readme).

herrherrmann avatar Aug 24 '14 17:08 herrherrmann

Hi, I hope I'm not late but I found the solution and works for me. Use the path for your sass-convert file as below in the brackets.json.

"beautify.sassConvertPath": "C:/Ruby200-x64/bin/sass-convert"

Above is the path in my machine, you path may be different. What you need to notice is I used forward slash in the path to separate folders. Anyways you need to wait 2 or 3 seconds to see the beautified code.

BaldBit avatar Sep 23 '14 04:09 BaldBit

@ryxle Yeah that worked! Thanks

bruceCzK avatar Sep 24 '14 14:09 bruceCzK

Thanks @tehkonst that fixed the issue for me.

sjmaceyful avatar Oct 22 '14 13:10 sjmaceyful

beautifying sass adds unwanted space after the first nested definition bildschirmfoto 2014-11-11 um 17 22 26

fynnit avatar Nov 11 '14 16:11 fynnit

Hey @mefynn, maybe your concern should be an own issue here on GitHub? Since this issue here is more about the general SCSS setup stuff?

herrherrmann avatar Nov 15 '14 12:11 herrherrmann

@tehkonst @sjmaceyful how exactly did u fix it? I tried : "beautify.sassConvertPath": "C:/Ruby193/bin/sass-convert" and "beautify.sassConvertPath": "C:\Ruby193\bin\sass-convert" and "beautify.sassConvertPath": "C:\Ruby193\bin\sass-convert.bat"

Also restarted brackets. None of this seemed to work.

pix-el avatar Feb 13 '15 07:02 pix-el

@pix-el I changed dir with my scss file from "C:/some folder1/some folder/my project/file.scss" to "C:/some_folder1/some_folder/my_project/file.scss" With spaces it didn't work.

tehkonst avatar Feb 14 '15 17:02 tehkonst

nothing has worked for me. My dir path to my scss files have no spaces. I do have underscores and dashes.

I am on windows so I've tried all of the following as well: "beautify.sassConvertPath": "C:/Ruby193/bin/sass-convert" and "beautify.sassConvertPath": "C:\Ruby193\bin\sass-convert" and "beautify.sassConvertPath": "C:\Ruby193\bin\sass-convert.bat"

now I have sass variables defined in separate files, but my main sass file imports these files in the correct order and has no issue resolving the variables. not sure if that would effect the beautify plugin at all, but thought it was worth mentioning.

any help? same error as others "An error occured formatting the SASS file"

clemsontiger avatar Mar 06 '15 13:03 clemsontiger

Please update to latest version on GitHub and have a look at configuring languages and external formatters.

Hirse avatar Jun 12 '16 14:06 Hirse