Answers for "scss how to use map"

CSS
1

scss how to use map

// _component.scss
$configuration: (
  padding: 1em,
  margin: 0 1em,
  color: grey
);

.element {
  color: map-get($configuration, color);
  padding: map-get($configuration, padding);
  margin: map-get($configuration, margin);

  &::before {
    background-color: map-get($configuration, color);
  }
}
Posted by: Guest on November-24-2020

Browse Popular Code Answers by Language