badsyntax / sassbeautify Goto Github PK
View Code? Open in Web Editor NEW[not maintained] A Sublime Text plugin that beautifies Sass files.
Home Page: https://github.com/badsyntax/SassBeautify
License: MIT License
[not maintained] A Sublime Text plugin that beautifies Sass files.
Home Page: https://github.com/badsyntax/SassBeautify
License: MIT License
Sass 3.2.18 (Media Mark)
ruby 2.0.0p247
I just installed the package and get this error. Any help would be appreciated.
usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in to_specs': Could not find sass (>= 0) amongst [] (Gem::LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in
to_spec'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:1231:in `gem'
from /usr/local/bin/sass-convert:22
Implement new commands:
I get this error when using SassBeautify on any file:
There was an error beautifying your Sass:
OptionParser::InvalidOption: invalid option: --indent
Use --trace for backtrace.
For example:
(http://sass-lang.com/documentation/file.SASS_REFERENCE.html#the__flag)
@extend .clearafter-fix !optional;
To:
@extend .clearafter-fix; !optional
This then doesn't compile properly.
Hello,
When ever I try to run SassBeautify in ST2 or ST3 I receive the following error:
There was an error beautifying your Sass:
OptionParser::InvalidOption:
invalid option: --indent
Ay help would be greatly appreciated.
This should resolve a lot of the issues related to using this plugin with RVM.
hi there and thanks for the plugin.
i was wondering on how to install the plugin for sublime 3 as dropping the zip of the python 3 branch into the packages folder doesn't work for me ....
thanks for help,
m
Hi, Trying to use the plugin and I get this error:
"There was an error beautifying your Sass:
[Errno 2] No such file or directory: 'sass-convert'"
Probably something with my configuration rather than the plugin but thought I would log it just in case. Will look into the issue when I have more time. Vince
On slower machines, the sass complication can take a bit of time and the sub-process will freeze the editor. We should use threading to prevent the editor from locking up.
Hello Sir
Really cool tool, but any chance it will work in Sublime Beta 3 in the future?
Hi !
There is a problem with the comments when I use SassBeautify.
My SCSS code :
@mixin opacity($opacity) { filter: alpha(opacity=#{$opacity}); // IE 5-9+ opacity: $opacity * 0.01; } $color1: #FF0000; // Red $color2: #FFBF00; // Orange $color3: #FFFF00; // Yellow
When I use SassBeautify, here is the result :
@mixin opacity($opacity) { filter: alpha(opacity=#{$opacity}); // IE 5-9+ opacity: $opacity * 0.01; } $color1: red; // Red $color2: #ffbf00; // Orange $color3: yellow; // Yellow
I hope you will find a solution to this issue. :(
Your extension is almost perfect ! (I'd also like SassBeautify usable with CSS files. And by the way, an option to choose if we want, or not, a space between two declarations blocks or before comments ! Maybe some future features ? :p)
Thanks a lot for your attention !
Could there be an option for sort (ex. alphabetically)? Or is there a sort applied already?
Just tried to use SassBeautify with ST2 (both on newest versions) on OSX. Since I use rbenv, I did a "which sass-convert" to get the path where sass-convert is location and added that into the SassBeautify path setting.
When I run the beautify command from the console, sublime text quits immediately without any warning. Any ideas?
I'm using this ticket to track feature requests from users that I might decide to implement in the future.
There was an error beautifying your Sass:
/Users/pratikbothra/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:298:in to_specs': Could not find 'sass' (>= 0) among 14 total gem(s) (Gem::LoadError) from /Users/pratikbothra/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/dependency.rb:309:in
to_spec' .......
I have updated to the latest sass version, and used the path as mentioned in the readme echo $path (Yes, I've read the README (multiple times))
carpe-diem (mentions) λ sass --version
Sass 3.3.10 (Maptastic Maple)
carpe-diem (mentions) λ sass-convert --version
Sass 3.3.10 (Maptastic Maple)
Any suggestions on where I could have gone wrong? I don't think Sass is installed incorrectly, as the sass files build correctly. Certain the error is due to RVM, and path issues because it works perfectly on my friend's laptop.
{
"indent": 2,
"dasherize": false,
"old": false,
"path": "/Users/pratikbothra/.rvm/gems/ruby-2.1.1/bin:/Users/pratikbothra/.rvm/gems/ruby-2.1.1@global/bin:/Users/pratikbothra/.rvm/rubies/ruby-2.1.1/bin:/Users/pratikbothra/.nvm/v0.10.29/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/pratikbothra/bin:/usr/local/Cellar/sbt/0.12.0/bin:/Users/pratikbothra/pear/bin:/Users/pratikbothra/.rvm/bin",
"beautifyOnSave": true
}
Any suggestions are welcome?
Hi,
How can I use it with rbenv
installed? Except linking to /bin
which sass-convert
/Users/pain/.rbenv/shims/sass-convert
Add a SassBeautify option to the context menu when right clicking on Sass files in the sidebar.
Can I ignore converting values below zero?
Why did you decided that it will be better 0.2 than .2 ?
padding-top: .3em;
converts to
padding-top: 0.3em;
How can I prevent this feature?
I expect it staying .3em
I've been trying to add an option to this plugin to run SassBeautify on the save of a sass/scss file. I tried adding a sublime_plugin.EventListener class to SassBeautify to call the "sass_beautify" command in the on_pre_save() method (https://www.sublimetext.com/docs/3/api_reference.html#sublime_plugin.EventListener). I had to do a little fiddling to stop an infinite loop of the save calling beautify calling save calling beautify calling...
The next issue I ran into was that the on_pre_save() method actually completes before the "sass_beautify" command runs. In fact, on_post_save() completes before the "sass_beautify" command can run. I'm pretty sure it is because "sass_beautify" runs things on a background thread thus allowing on_pre_save() to complete. I put a print statement in on_pre_save(), on_post_save(), and in ExecSassCommand.run() right inside the try statement. The print statement in ExecSassCommand.run() was the last one to print in the console.
What this means is that I can have it beautify when I save the file, but the changes are technically made after ST3 completes the save, thus the file is left in a modified state.
Given that ST3 runs all plugins in a separate process, is there any plan to create an ST3 version of SassBeautify without the threading?
Hi,
Internally, it's trying to execute sass-convert, but on my machine this doesn't work. I'm sure this is because I have multiple ruby gems installed.
To fix this, you need to let users override the environment path via the settings file.
Hi,
I try to convert SCSS file to current type (SASS) but I have an error :
There was an error beautifying your Sass:
[Errno 2] Aucun fichier ou dossier de ce type
I have removed and reinstall SassBeautify without success
When code is currently beautified, any comments are sent to a new line below their original place. It would be nice to have an option to leave them where they are.
Any hopes for an option for tabs or spaces?
'sass-convert' is not recognized as an internal or external command, operable program or batch file.
Is there a way for the SassBeautify to eliminate all the spaces after a ":" for example:
Before
background: $c_body;
color: $c-white;
text-align: left;
After it runs the cmd:
background:$c_body;
color:$c-white;
text-align:left;
Is this doable?
Thanks :)
Hi there,
I have an issue with accents.
(Yep, sorry, i'm french.) :p
Here is a comment before using SassBeautify
// à é ç è ù
Here is the same after using SassBeautify :
// ├á ├® ├º ├¿ ├╣
(And the same after again, just for fun)
// Ôö£├í Ôö£┬« Ôö£┬║ Ôö£┬┐ Ôö£Ôòú
I'm using Sublime Text 2.0.2 and SassBeautify 2013.08.12.20.57.29
Thanks !
Hi !
Sorry, I found another issue. :)
/* // Lorem ipsum Nisi aute velit quis. .lorem{ipsum:none;} */
When I use SassBeautify, the first /* becomes //
// // Lorem ipsum Nisi aute velit quis. .lorem{ipsum:none;} */
I can't comment code that has inline comments...
That's all ! :)
Thanks a lot,
William
Sass file doesn't seem to Beautify
All stays as white color.
Hi !
Sorry to borrow you with my issues !
I have a new PC at work, Windows 8 64 bits.
I wanted to test your example from your comment (from my feature request), and I noticed that it did not work at all for all my .scss files.
What I did, from the start to the bug :
.i-have-a-problem{color:blue; &.yes-me-too{color:red;} }
Did I missed something ?
Is my computer the problem ? As a Freelance (anymore since the last week) I used SassBeautify on my Laptop with Windows 7 64 bits.
Thank you for your help.
For example:
html {
background-color: #444;
font-size: 62.5%; /* Base 10 */
}
body {background-color: #eeeeee;}
Hey,
Firstly, great package
As title really. Often I don't want to format the entire file, just a specific piece. This extra functionality would save me the hassle of copy/pasting code elsewhere to format.
Yours hopefully,
Move to using PEP 8 style. http://www.python.org/dev/peps/pep-0008/
Consider using this plugin: https://sublime.wbond.net/packages/Python%20PEP8%20Autoformat
Hi !
This is not an issue, but a feature request. :)
Maybe you could just put an option (in the settings file) allowing us to use it wherever and whenever we want to ?
Thank you !
Hey,
You should get this listed on https://sublime.wbond.net/
Useful plugin - keep up the good work!
Best regards,
Hi, I'm trying to get this working on ST3 and I'm getting the following error:
'sass-convert' is not recognized as an internal or external command, operable program or batch file.
I assume this is because my Path setting is wrong:
"path": "C:\Users\AccountName\AppData\Roaming\NetBeans\7.3\sass-3.1.20\bin" <- using double forward slashes on all slashes here
I'm trying to use the sass-convert that was already installed on my Windows 8 PC by Prepros or Netbeans; is it possible?
Thanks!
I'm on Ubuntu 14 and using RVM
and my $echo path is /home/jitendra/.rvm/gems/ruby-1.9.3-p327/bin:/home/jitendra/.rvm/gems/ruby-1.9.3-p327@global/bin:/home/jitendra/.rvm/rubies/ruby-1.9.3-p327/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jitendra/.rvm/bin
When I paste this as a path value I get this error
Error trying to parse settings: Expected value in Packages/User/SassBeautify.sublime-settings:5:13
My setting file http://pastebin.com/SVbvqbR7
If you want to use the opposite of a variable, you'd do something like:
margin: 0 (-$pad) 20px (-$pad);
but SassBeautify turns it into:
margin: 0 -$pad 20px -$pad;
which doesn't work the same.
when running SassBeautify I get the error:
OptionParser::InvalidOption: invalid option: -E
Use --trace for backtrace.
i'm a new st user, trying to install in st3/3059, but saasbeautify isn't showing up in the package list cmd-shift-p...? am i missing something? do i need to clone git repo an place in some st3 folder or something?
regards,
tony
When I run SassBeautify with blanklineBetweenSelectors set to true, the following:
.class-one,
.class-two,
.class-three {
background-color: $aaa;
}
becomes:
.class-one,
.class-two,
.class-three {
background-color: $aaa;
}
I found the regex code that deals with this
# Insert a blank line between selectors. (Issue #30)
if self.get_type() == 'scss' and self.settings.get('blanklineBetweenSelectors', False):
output = re.sub(r'\n\n\n', '\n\n', re.sub(r'(.*)\{', r'\n\1{', output).strip())
This obviously requires the code to search back previous lines of scss until it finds the first one in the list. I'll keep thinking to see if I can come up with a solution. Might be easier to do this while the file is split up by line (where you're making sure the file uses unix-style newline characters).
By the way, I ran into this while trying to use SassBeautify in conjunction with SublimeLinter-contrib-scss-lint. It has a rule for a single selector per line. I'm finding that sass-convert isn't very compatible with scss-lint.
I like my properties to be single-line. I've been writing them like this for 9 years.
For Example:
ul{ height:100px; width:50px; list-style:none; }
I would really like such a setting
There was an error beautifying your Sass:
Error on line 1: Invalid US-ASCII character "\xE3"
Use --trace for backtrace
Use --trace for backtrace.
Thanks for this useful tool.
Beautifying a .scss file will expand
.test1 {
display: block;
}
// Comment
.test2 {
display: block;
}
to:
.test1 {
display: block;
}
// Comment
.test2 {
display: block;
}
This separation of comment and associated code block is probably not intended behaviour.
The variable, $max-width, becomes $max_width regardless of settings in my config for SassBeauty. The entire line looks like this:
@include dropdown-container( $content: content, $triangle: false, $max-width: 100% );
Apart from that no classes are affected and no other variables are altered. I'm reluctant to post this issue as it'll turn out to be my own derp, but I'll update if that's the case.
Is it possible to make this alphabetise the order of the CSS attributes within all declarations?
Whil this is a great plugin, I think it needs to support the famous SASS linting guidlines as defined for example with plugins like in; https://github.com/causes/scss-lint/blob/master/config/default.yml which is used withing this plugin; https://github.com/attenzione/SublimeLinter-scss-lint
I am using scsslint (requiring a newline after a rule declaration)
preserving newlines should be an option.
SassBeautify collapses all newlines which forces the user to set the linter to use this as a coding style.
Since the coding style should not be affected by a beautifier it would be nice if this could be added
*.[scss|sass]
There was an error beautifying your Sass:
[Errno 2] No such file or directory
Does 'sass-convert' exist in PATH?'
sass-convert
is OK. Sass 3.2.10 (Media Mark) on OSX 10.8.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.