Say I have a module button like this (button.scss):
.m-button {
width: 125px;
height: 35px;
color: white;
display: inline-block;
}
And a colors file like this which defines colors (colors.scss):
$light-grey: #EFEFEF;
$dark-grey: #4E4E4E;
$less-dark-grey: #5F5F5F;
I want to be able to put these buttons throughout my site, and easily choose a background color for the button by assigning it the correct class like this:
<div class="m-button background-light-grey">Click Me </div>
But I'd like to avoid having to write all the background-color definitions. Is it possible in SASS using mixins or functions to do basically look at all my colors and make a background-color class for each one which sets the background-color style appropriately?