HTML To Scss
Sublime plugin
Details
Installs
- Total 3K
- Win 3K
- Mac 269
- Linux 255
| Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Readme
- Source
- bitbucket.org
html2scss
This plugin parse your html and puts its scss rules(grouped by classes) into clipboard.
Usage
The package provide 1 command - html2scss with 1 optional argument - all_attrs = False. You can use it with shortcut or run from command palette(html2scss)
After you run the command in your html file, you'll see message in status bar: scss rules copied!. By default all file will be parsed, but you can select any region you need.
Now you can paste the rules in your scss file with Ctrl+v
Example
Input html:
<div class="class1">
<div class="class2" id="id2" >
<div>
<div class="class5"></div>
<div class="class3 cls3 cls3--mod" test></div>
<div class="class3 otherClass"></div>
<div class="class3 cls3" data-attribute attr="simple" test></div>
<div class="class4"></div>
<div class="class4"></div>
<a href="#"></a>
</div>
</div>
</div>
Result rules:
.class1 {
#id2.class2 {
.class5 {
}
.class3 {
&.cls3 {
&.cls3--mod {
}
}
&.otherClass {
}
}
.class4 {
}
}
}
Result rules with all_attrs:
.class1 {
#id2.class2 {
.class5 {
}
.class3 {
&.cls3 {
&.cls3--mod[test] {
}
&[data-attribute][attr="simple"][test] {
}
}
&.otherClass {
}
}
.class4 {
}
}
}