Answer the question
In order to leave comments, you need to log in
How to rebuild a mixin?
Actually, subject.
I'm trying to make a construction for displaying font-size for media queries, where $queries: $sm, $md, $lg, $xl;
- screen resolutions, $sizes: $fzh6, $fzh5, $fzh4, $fzh3, $fzh2, $fzh1;
- font size.
But in an attempt to put together - confused even worse.
@each $query in $queries {
@media (max-width: #{$queries}) {
@mixin media-sizes($sizes) {
@for $i from 1 through 6 {
h#{$i} {
font-size: $sizes;
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
In general, everything is very simple:
@each $query in $queries {
@media (max-width: #{$query}) {
@for $i from 1 through 6 {
h#{$i} {
font-size: nth($sizes, $i);
}
}
}
}
$sizes: (
h6: $fzh6,
h5: $fzh5,
h4: $fzh4,
h3: $fzh3,
h2: $fzh2,
h1: $fzh1
);
@each $query in $queries {
@media (max-width: #{$query}) {
@each $tag, $size in $sizes {
#{$tag} {
font-size: $size;
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question