(SCSS) Get-Map

(SCSS) Get-Map

Creating variables, or tokens, is pretty handy when you want to tidy up your styles. You can create what I call a grouped variable.

$my-cool-variable: (
  light: #FFFFFF,
  medium: #CCCCCC,
  heavy: #000000,
);

You can then use the variable like this:

a {
  color: map-get($my-cool-variable, medium);
};

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *