Menu icon Foundation
Using interchange to replace CSS class

I have been searching for this for a while and can't seem to find an answer either way. Is it possible to use Interchange to change a CSS class based on break points? For example, I have content boxes that with in landscape mode break but each box also has a right margin. Ideally I would like to trigger a new class that removes the margin when stacked.

interchangecssclassmobile

I have been searching for this for a while and can't seem to find an answer either way. Is it possible to use Interchange to change a CSS class based on break points? For example, I have content boxes that with in landscape mode break but each box also has a right margin. Ideally I would like to trigger a new class that removes the margin when stacked.

Karl Ward over 5 years ago

Why change the CSS class? The whole point of CSS media queries, which is fundamental in Foundation, is to apply different styles to a class at different breakpoints. For example:

.content-box {
  margin-right: 0px:
}
@media all and (min-width: 1024px) {
  .content-box {
    margin-right: 20px:
  }
}

If you use foundation with sass, it's even nicer ...

It would be impractical and superficial to use interchange for something like that ...