Helpers
We'll place all of our functions and mixins in a folder called helpers
. We'll place our mixins in a folder called mixins and functions in a folder called, you guessed it, functions. We'll then create a file in the root of the helpers directory called all.scss which will include all of our functions and mixins in the correct order. This will help avoid cluttering up our style.scss file with functions and mixins.
Your folder structure should be like so:
scss |-- helpers |-- _all.scss |-- mixins |-- functions
Function – get
We'll be working with maps quite a bit. So we'll add our get
function from Chapter 5, Advanced Sass, which allows us to do away with the verbose map-get
syntax in favor of a much simpler, cleaner syntax. Create a file called get.scss in the scss/helpers/functions directory. Inside that place the following code:
// Function for retrieving deeply nested map values @function get($map, $arglist...) { $m: $map...