Created
June 14, 2018 13:18
-
-
Save furzeface/b365e7d4476c85a0edb4a0956aa60501 to your computer and use it in GitHub Desktop.
ITCSSify things. I keep needing to do this when refactoring legacy projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p ./src/styles | |
touch ./src/styles/main.scss | |
mkdir -p ./src/styles/{base,components,generic,objects,settings,tools,trumps} | |
touch ./src/styles/{base,components,generic,objects,settings,tools,trumps}/__index.scss | |
echo "// Base - Unclassed HTML elements (type selectors)" > ./src/styles/base/__index.scss | |
echo "// Components - Designed components, chunks of UI" > ./src/styles/components/__index.scss | |
echo "// Generic - Ground-zero styles (normalize, resets, box-sizing etc)" > ./src/styles/generic/__index.scss | |
echo "// Objects - Cosmetic-free design patterns" > ./src/styles/objects/__index.scss | |
echo "// Settings - Global variables, config switches" > ./src/styles/settings/__index.scss | |
echo "// Tools - Default mixins and functions" > ./src/styles/tools/__index.scss | |
echo "// Trumps - Helpers and overrides" > ./src/styles/trumps/__index.scss | |
echo "/* ============================================================ *\\ | |
# Client name: Project name | |
/* ============================================================ */ | |
/** | |
* Settings - Global variables, config switches | |
* Tools - Default mixins and functions | |
* Generic - Ground-zero styles (normalize, resets, box-sizing etc) | |
* Base - Unclassed HTML elements (type selectors) | |
* Objects - Cosmetic-free design patterns | |
* Components - Designed components, chunks of UI | |
* Trumps - Helpers and overrides | |
*/ | |
@import 'settings/_index'; | |
@import 'tools/_index'; | |
@import 'generic/_index'; | |
@import 'base/_index'; | |
@import 'objects/_index'; | |
@import 'components/_index'; | |
@import 'trumps/_index';" > ./src/styles/main.scss | |
# test it out | |
mkdir -p ./public/styles | |
sass ./src/styles/main.scss ./public/styles/main.css |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sets up the relevant directories, imports and comments in files for restructuring legacy (S)CSS into more of an ITCSS structure.