Browsed by
Tag: Shell Scripts

New Useful Shell Script

New Useful Shell Script

I’ve modified my SCSS Breakpoints Shell Script a tiny bit to now add @import <<viewport size>> for each of the module viewport breakpoints to my main theme.scss file. I’ve set this up to work with my own setup, but if it’s useful to anyone else I’ve added it to github.

View on Github

Previous Posts:

http://www.dgmyspace.dumgal.ac.uk/eportfolios/rumbler/useful-shell-scripts/
Useful Shell Scripts

Useful Shell Scripts

I wrote a couple of Shell Scripts to save time when splitting SCSS into breakpoint files.

https://github.com/dgrumbler/useful_shell_scripts

$ sh sassBreakpoints.sh

This creates a named folder based on the name of the module you type in.
It then creates all the breakpoints :

  • _base.scss
  • _481up.scss
  • _768down.scss
  • _768up.scss
  • _899down.scss
  • _900up.scss
  • _1029down.scss
  • _1030up.scss
  • _1240up.scss
  • _1400up.scss
  • _1600up.scss
  • _1900up.scss

Then for each breakpoint it adds the following:

/****************************************************************
	Theme: << Module Name >>
	Viewport: << Viewport Size >>
	Author: << Author >>
****************************************************************/

Replacing Module name, viewport size and author with the user input and filename.

e.g.

/****************************************************************
	Theme: Carousel
	Viewport: 768 up
	Author: Rebecca Rumble
****************************************************************/

This one does the same as the above except it doesn’t create a folder and runs in the current directory.

$ sh sassBreakpointsNoFolder.sh
https://www.dgmyspace.dumgal.ac.uk/eportfolios/rumbler/new-useful-shell-script/