[not maintained] A Sublime Text plugin that beautifies Sass files.
MIT License
https://sublime.wbond.net/packages/SassBeautify
A Sublime Text plugin that beautifies Sass files. (Compatible with Sublime Text 2 & 3.)
This plugin uses sass-convert
, and so you need to have sass installed. Read the sass download page to view the installation options.
It's a good idea to always use the latest version of Sass.
Option 1 (recommended)
Install via package control:
Option 2
Manual download:
Default usage
Run the plugin from the command palette:
Conversion usage
Run the conversion commands from the command palette:
Once installed, you can customize how the beautification works by changing the package settings.
Preferences >> Package Settings >> SassBeautify >> Settings - Default
Preferences >> Package Settings >> SassBeautify >> Settings - User
The following settings can be adjusted:
{
// How many spaces to use for each level of indentation. "t" means use hard tabs.
"indent": 4,
// Convert underscores to dashes.
"dasherize": false,
// Output the old-style ":prop val" property syntax. Only meaningful when generating Sass.
"old": false,
// Custom environment PATH.
"path": false,
// Custom environment GEM_PATH.
"gemPath": false,
// Beautify the sass file after saving it?
"beautifyOnSave": false,
// Keep "inline" comments inline?
"inlineComments": false,
// Add a new line between selectors?
"newlineBetweenSelectors": false,
// Use single quotes everywhere
"useSingleQuotes": false
}
The plugin does not set any default key bindings, thus you will need to specify your own.
In your keymap file (Preferences >> Key bindings - User), add a custom key binding:
[
{
"keys": ["alt+w"],
"command": "sass_beautify"
}
]
If you installed ruby and sass via a version manager tool like RVM, rbenv or via an installer like ruby installer, then you're likely to encounter issues with running sass-convert
from Sublime Text.
You need to specify the custom PATH
and GEM_PATH
values in your SassBeautify user settings.
Follow the steps below:
echo $PATH
PATH
into the 'path' settingecho $GEM_PATH
GEM_PATH
into the 'gemPath' settingDuring the install process, there should be an option to add ruby to your environment PATH. Ensure this option is selected.
This plugin should work on Linux (tested on Ubuntu 12.04), Windows (tested on Windows 7/8) and OSX (tested on 10.5.7).
Please create an issue if you find it doesn't work as expected on your setup.
Thanks to the contributors and to all the people who have tested and reported issues.
Licensed under the MIT license. Created by Richard Willis