在Sass中使用wilcards

时间:2018-01-21 17:36:28

标签: css sass

我有这个SASS代码:

.card.job.card-border-color-6:hover .button {
  background: #ffdedb;
  transition: background 400ms ease-in-out;
}

.card.job.card-border-color-6 .button:hover {
  background: hsl(14,  100%, 53%);
  color: white;
  transition: background 400ms ease-in-out;
}

但我希望通过某种通配符语法使其具有通用性,如下所示:

.card.job.card-border-color-*:hover .button {
  background: #ffdedb;
  transition: background 400ms ease-in-out;
}

.card.job.card-border-color-* .button:hover {
  background: hsl(14,  100%, 53%);
  color: white;
  transition: background 400ms ease-in-out;
}

然而这种语法不正确,Sass编写此代码以使其通用的正确方法是什么?

0 个答案:

没有答案