How to compare 2 different lists values in SCSS?

2019-08-21 07:40发布

问题:

$mq-grid: (
  xs: 576px,
  sm: 768px,
  md: 992px,
  lg: 1200px
)!default;


$bp-fonts: (
  .6rem, 
  1.1rem, 
  1.24rem, 
  1.4rem
);

For example, I have 2 different $maps like the above.

when the $map blocks set like that, is it possible to compare indexes from 2 different $map lists in SCSS?

The code I imagine is like this:

@for $i from 0 to length($bp-fonts) {
  @if mq-grid $val == $bp-fonts[$i] {
    // contents go here
  }
}