Getting Error passing Media Queries to a SASS mixin: Error: Undefined mixin

Getting Error passing Media Queries to a SASS mixin: Error: Undefined mixin

我在将 mixins 传递到我的 scss 文件时遇到错误,我将相同的 mixins 用于我的另一个项目并且工作正常。但是当我尝试使用相同的 mixin 时,我得到了一个错误。

代码如下:-

.carousel-wrapper {
          padding: 0 0 20px;

          @include screen(custom, min, 669) {
            padding: 0;
          }

          .carousel-stage {
            transition-timing-function: cubic-bezier(
              0.77,
              0,
              0.175,
              1
            ) !important;
            padding-left: 660px;
            padding-right: 660px;
            width: 6944px;
            transition: all 0.6s ease 0s;
          }
        }

错误:- Here is the image of the Error

这是我使用的 Mixins:-

///Media Queries

$breakpoint-small: 575.98px;
$breakpoint-med-small: 767.98px;
$breakpoint-med: 991.98px;
$breakpoint-large: 1199.98px;
@mixin screen($size, $type: max, $pixels: $breakpoint-small) {
  @if $size == "small" {
    @media screen and ($type + -width: $breakpoint-small) {
      @content;
    }
  } @else if $size == "med-small" {
    @media screen and ($type + -width: $breakpoint-med-small) {
      @content;
    }
  } @else if $size == "med" {
    @media screen and ($type + -width: $breakpoint-med) {
      @content;
    }
  } @else if $size == "large" {
    @media screen and ($type + -width: $breakpoint-large) {
      @content;
    }
  } @else if $size == "custom" {
    @media screen and ($type + -width: $pixels + px) {
      @content;
    }
  } @else {
    @content;
  }
}

你的mixin好像没问题,肯定是声明问题。

混合代码与第一个代码在同一个文件中吗?

如果没有,您应该将代码复制粘贴到同一个文件中,或者使用@import 将其导入。