Как написать этот оператор в Scss? - PullRequest
0 голосов
/ 05 сентября 2018

Я пытаюсь добавить строку the color is green в html на основе ввода, который я даю в scss.

@mixin jeansColor($jeancolor) {
  if(type-of($jeancolor)==string) {
    content: "the color is green"
  }
}

.jeans:after {
  @include jeansColor("green");
}
<p class="jeans"> Jeans </p>

1 Ответ

0 голосов
/ 05 сентября 2018

Это всегда мелкие детали ... просто забыл создать экземпляр if с @: CodePen :)

@mixin jeansColor($jeancolor) {
  @if(type-of($jeancolor)==string) {
    content: "the color is green"
  }
}

.jeans:after {
  @include jeansColor("green");
}
<p class="jeans"> Jeans </p>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...