D
D
DoubleWish2019-01-09 14:13:22
css
DoubleWish, 2019-01-09 14:13:22

How to make a mixin map for this kind of use?

Hello!
There is a very useful article here for organizing indents - link .
I'm trying to make a mixin for this use:

$levels: (
    blue: (80px, 96px, 128px, 128px, 144px, 192px, 256px),
    violet: (56px, 64px, 72px, 96px, 112px, 152px, 200px), 
    orange: (56px, 64px, 72px, 72px, 80px, 112px, 152px), 
    red: (32px, 40px, 40px, 48px, 48px, 64px, 88px), 
    green: (16px, 24px, 24px, 24px, 24px, 32px, 48px)
);

via @if map-has-key but nothing comes out.
Has anyone repeated this? Maybe it's not through the map should be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2019-01-09
@Flying

map-has-key- this is a function of working with map, but in fact you have a map of lists i.e. through map-has-key and map-get you get the element of the corresponding "color", and access to the elements of the list must go through the functions of working with lists, for example, through @for or @each , or if you know the position in the list, then via nth()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question