Skip to content

Instantly share code, notes, and snippets.

@anthonyLukes
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save anthonyLukes/8466c51b64a5418b16ab to your computer and use it in GitHub Desktop.

Select an option

Save anthonyLukes/8466c51b64a5418b16ab to your computer and use it in GitHub Desktop.
This is a handy bash utility for creating stubbed sass directories and sass files.
ASSETS_DIR="./src/assets/scss/"
if [ -z "$5" ]
then
SASS_DIR="modules/";
else
SASS_DIR=$5/;
fi
TARGET_DIR=$ASSETS_DIR$SASS_DIR;
mkdir $TARGET_DIR$1;
touch $TARGET_DIR$1/_$1_screen.scss;
if [ "$2" = "y" ]
then
touch $TARGET_DIR$1/_$1_small.scss;
fi
if [ "$3" = "y" ]
then
touch $TARGET_DIR$1/_$1_medium.scss;
fi
if [ "$4" = "y" ]
then
touch $TARGET_DIR$1/_$1_large.scss;
fi
@anthonyLukes
Copy link
Copy Markdown
Author

Use this bash script to generate sass directories and files easily from your site root.

  1. Save this to your site root as mkmod.sh
  2. type ./mkmod.sh [module name] [include _small] [include _medium] [include _large] [directory override in scss]

For example

 ./mkmod.sh masthead n n n landmarks

will generate a /masthead directory in /landmarks with a _masthead_screen.scss file.

Likewise

 ./mkmod.sh grid y y y

will generate a /grid directory in /modules (modules is the default so the last parameter is optional) with _grid_screen.scss, _grid_small.scss, _grid_medium.scss, and _grid_large.scss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment