V
V
Valentin Popov2018-07-11 17:27:41
Sass
Valentin Popov, 2018-07-11 17:27:41

Why is the sass mixin not working?

I'm trying to use the sass mixin in a project, but for some reason it doesn't work.
My folder structure is as follows:
5b461424a9be0683601112.jpeg
The mixin itself looks like this:

@import '../config/variables';

@mixin tablets {
  @media screen and (max-width: $tablets){
    @content;
  }
}

@mixin mobile {
  @media screen and (max-width: $mobile){
    @content;
  }
}

I import this mixin into the base.scss file:
5b461430c7eb3639825148.jpeg
In base.scss I use the mixin as follows:
.search__filter {
  width: 100%;
  padding: 20px;
  font-size: 20px;

  &:focus {
    outline: none;
  }

  @include mobile {
    font-size: 30px;
  }
}

But for some reason nothing works, because of what it can be? ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Matvey Phoenix, 2018-07-11
@mtvphnx

Write @include mobile() and everything will work.
PS also check the paths, you are referring to 'mixins', but you need '_mixins.scss'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question