You can install it with these https://sublime.wbond.net/installation.
Go to Package Control: Install Packages and install RegReplace
Go to Preferences > Package Settings > Reg Replace > Settings - User, and paste https://gist.github.com/natecavanaugh/bcefc9aba3d96d3cc79a#file-reg_replace-sublime-settings into the file.
Go to Preferences > Package Settings > Reg Replace > Commands - User, and paste https://gist.github.com/natecavanaugh/bcefc9aba3d96d3cc79a#file-default-sublime-commands into the file.
- Open your CSS File and select the CSS you wish to split
- Launch the GoTo Anything Palette (ctrl/cmd + shift + P)
- Type "Separate Skin and Structure"
- This will duplicate your CSS file into two blocks: a "Structure" section at the top, and a "Skin" section at the bottom (which has the
/*Skin*/
comment above it)
- This will duplicate your CSS file into two blocks: a "Structure" section at the top, and a "Skin" section at the bottom (which has the
- Select the CSS in the "Structure" section (so the rules above the Skin comment)
- Launch the GoTo Anything Palette (ctrl/cmd + shift + P)
- Type "Clean Structure", and select it
- Now select all of the CSS in the "Skin" section (everything under the Skin comment)
- Again, Launch the GoTo Anything Palette (ctrl/cmd + shift + P)
- Type "Clean Skin", and select it
You should now have two sections split out and the top one (the "Structure") holding only structural rules, and the bottom one (the "Skin") containing only decorational rules.
However, this isn't perfect, so you may need to go through and check that the formatting is still okay (no extraneous new lines, etc), as well as retest the CSS to make sure nothing was messed up (though that should be fairly limited).
The main ones to look out for are border
rules.
For instance, this rule:
.some-rule {
border: 1px solid #F00;
}
should be split up like this:
/*Structure*/
.some-rule {
border: 1px solid transparent;
}
/*Skin*/
.some-rule {
border-color: #F00;
}
But unfortunately, I haven't figured out how to best do this, so they need to be manually done for now.