Sass FormatterSass formatter extension for VS Code built on top of sass-convert. Beautify sass, scss and css files. ImportantSince the latest version od Sass (Dart Sass) not providing a RequirementsRequires Ruby Sass command-line tools to be installed. Tested sass command-line tools: Ruby Sass Gem v3.7.4. It is important to say that Dart Sass introduced on March 26, 2018, is not supported by this extension because More details about Sass Syntax used in this formatter. Install Ruby Sass via command-lineThis procedure was official before March 26, 2018. With the release of Dart Sass 1.0.0, Ruby Sass become officially deprecated. More official links about a transition from Ruby Sass to Dart Sass: So instead of following this Install Sass, which will install Dart Sass, please follow the old official procedure below for installing Ruby Sass instead. LinuxIf you're using a distribution of Linux, you'll need to install Ruby first. You can install Ruby through the apt package manager,
WindowsBefore you start using Sass, you will need to install Ruby. The fastest way to get Ruby on your Windows computer is to use Ruby Installer. It's a single-click installer that will get everything set up for you super fast. The installer will also install a Ruby command-line PowerShell application that will let you use the Ruby libraries. MacIf you prefer the command-line over an application, then getting Sass set up is a fairly quick process. Sass has a Ruby dependency, but if you're using a Mac, congratulations, Ruby comes pre-installed. Install Ruby SassHere's the quickest way we've found to start using Sass by using the command-line:
This will install Sass and any dependencies for you. It's pretty magical. If you get an error message, then it's likely you will need to use the
It should return UsageFiles can be formatted on-demand by right-clicking in the document and selecting Format Document in the editor context menu, using the associated keyboard shortcut, or by running command Format Document from the Command Palette. Default keyboard shortcuts for Format Document command:
Selection can be formatted on-demand by right-clicking in the document and selecting Format Selection in the editor context menu, by using the associated keyboard shortcut, or by running command Format Selection from the Command Palette. Default keyboard shortcuts for Format Selection command:
By default, formatter using UTF-8 encoding to ensure proper encoding of all characters. This allows us to use Unicode characters directly in our styling files:
To automatically format on paste, add the following to your settings.json file: To automatically format a file on saving, add the following to your settings.json file: To automatically insert a final newline at the end of the file when saving it, add the following to your settings.json file: Sass Formatting DemoSass Formatter SettingsThis extension contributes the following settings:
Features Roadmap
Known issuesIf you're using ZSH, or if you installed Ruby and Sass via a version manager tool like rbenv, RVM, then you are likely to encounter issues with running Additionally, if you're using Ruby Installer please check Add Ruby executables to the PATH setting during the installation process. Larger files need some time to be formatted. See below comparison table:
Note: Above speed results depends on your hardware and operating system. IssuesThis extension should work on Mac (tested on macOS Sierra 10.12.6), Linux (tested on Ubuntu 17.04) and Windows (tested on Windows 8.1) operating systems. On each operating system for testing purposes, I used the default setup, default shell and official procedure for installing VS Code and sass command-line tools. Please create an issue if you experience any issue with your setup. Also, I suggest trying always the latest version of Sass Formatter extension before report any issue. Following details will be useful for debugging:
Also, paste me the whole output from the Output panel (View > Output > Sass Formatter channel). And paste me the whole output from the Developer Tools console (Help > Toggle Developer Tools). Release Notes1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
|