Skip to content

Instantly share code, notes, and snippets.

@chrsgrffth
Created March 3, 2017 23:16
Show Gist options
  • Save chrsgrffth/d1d49b61f4d05e20aed69b702f9494dd to your computer and use it in GitHub Desktop.
Save chrsgrffth/d1d49b61f4d05e20aed69b702f9494dd to your computer and use it in GitHub Desktop.
// ----------------------------------------------------------------------------
// Map Functions
// ----------------------------------------------------------------------------
@function to-string($int)
@return inspect($int)
// Still trying to think through if functions would be better than variables.
// * Benefit of variables is autocomplete.
// * Benefits of functions is clearer logic and simplicity in mapping.
// ** Thinking `--` prefixed would identify functions provided by core to be
// used in component sass files.
// Returns mapped spacing value in rems.
// @param $key {Number or String} '05'
// @return {0.5rem}
@function $rem-value
@return map-get($spacing, to-string($key)) * 1rem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment