Visual Studio Code extension enables developers to convert HTML code to CSS / LESS / SCSS style syntax!
Please see preview & usage for more information.
Default usage:
- Copy valid HTML code (including opening & closing tags)
- Activate the window where you want to paste the converted style selectors & click right mouse button to get to the its context menus then select highlighted option:
Keybind usage:
- Copy valid HTML code (including opening & closing tags)
- Paste the code using key combination
CMD/CTRL+ALT+V
- It will paste CSS selectors to *.css files and SCSS / LESS selectors to all other files.
Alternative usage:
- Open command pallete by clicking
CMD/CTRL+SHIFT+P
- Type
Paste HTML converted to CSS / LESS / SCSS
and select suggested option
Via Quick Open:
- Download, install and open VS Code
- Press
CMD/CTRL+P
to open the Quick Open dialog - Type
ext install tautvydasderzinskas.vscode-html-to-css
- Click the Install button, then the Enable button
Via the Extensions tab:
- Click the extensions tab or press
CMD/CTRL+SHIFT+X
- Search for
html for css/less/scss
- Click the
Install
button, then theEnable
button
Via the command line:
- Open a command-line prompt
- Run
code --install-extension TautvydasDerzinskas.vscode-html-to-css
Extension provides these User and Workspace settings:
htmlToCss.hideTags
- hide tag selector if element has class or id (default: true)htmlToCss.convertBEM
- recognize BEM classes and split them accordingly (default: true)htmlToCss.preappendHtml
- pre-append comment containing transformed html structure (default: false)
This project uses big portion of logic written by Harry Horton.
Please check out his awesome scssifyhtml project!
The repository code is open-sourced software licensed under the MIT license.