Skip to content

Instantly share code, notes, and snippets.

@matthewstokeley
Created September 13, 2019 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewstokeley/0440696adc2f6314661d941223dee444 to your computer and use it in GitHub Desktop.
Save matthewstokeley/0440696adc2f6314661d941223dee444 to your computer and use it in GitHub Desktop.
a discarded white-space mixin with a robust parameter range
@mixin white-space( $options, $vertical: true )
$box-model-white-space: ()
$prop: null
@if ( type-of($options) == 'map' )
@each $rel, $map in $options
@if ( $rel != 'inner' and $rel != 'outer' )
$prop: 'padding'
@each $modifier, $unit in $options
#{ $prop }-#{ $modifier }: #{ $unit }
@if ( $rel == 'inner' )
$prop: 'padding'
@else
$prop: 'margin'
@each $modifier, $unit in $map
#{ $prop }-#{ $modifier }: #{ $unit }
@else
@if ( $vertical == true )
padding-bottom: $options
@else
padding-top: $options
padding-bottom: $options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment