V
V
Vyacheslav2015-01-16 01:38:16
css
Vyacheslav, 2015-01-16 01:38:16

How do you use Sass Maps?

Do not confuse with source-maps. As you use, preferably with code examples. I can google, I'm not very friendly with English.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Sorokin, 2015-01-16
@VitalySorokin

Sass Maps is great for declaring scope on variables like this:

$colors: (
  sexy: #FA6ACC,
  glamour: #F02A52,
  sky: #09A6E4
);

.element {
  background-color: map-get($colors, sky);
}

or for example, for font icons:
$icons: (
  glass: "\f000",
  music: "\f001",
  search: "\f002",
  envelope: "\f003",
  heart: "\f004"
);

@each $name, $icon in $icons {
  .fa-#{$name}:before {
    content: $icon;
  }
}
With sass maps, the possibilities are unlimited, there is a huge field for experimentation. Try it, keep it up!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question