B
B
Bohdan Zhorov2019-05-14 11:40:53
Sass
Bohdan Zhorov, 2019-05-14 11:40:53

How to properly write media queries sass?

Good afternoon! I read on the bootstrap off site that you can use queries like:

@include media-breakpoint-up(576px) {
  .some-class {
    display: block;
  }
}

As a result, I get an error like:
@include media-breakpoint-up(576px)
            ^
          No mixin named media-breakpoint-up

It looks like everything is connected. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-05-14
@sain_Fa

First, the name of the breakpoint must be passed to the parameter.
Second, you didn't include the bootstrap grid mixins in your file at all.
You need to include two files, then call mixins

@import 'bootstrap/variables';
@import 'bootstrap/mixins';

@include media-breakpoint-up(sm) {

}

Pay attention to the mixin parameter. Breakpoint names https://github.com/twbs/bootstrap/blob/b7040ad9b4/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question