scss - 开始一个部分命名的类

A. *_*Lau 2 css sass css3

我想知道是否有可能有一个部分完成的类名,然后我可以填写一些如何例如

.theme-color-* {
  happy {
    color: yellow
  }
  angry {
    color: red
  }
  sad {
    color: blue
  }
}
Run Code Online (Sandbox Code Playgroud)

当然,这代表了 .theme-color-happy, .theme-color-angry, .theme-color-sad

Ser*_* Tx 5

是的,你可以这样做,但你必须使用&:

.theme-color- {
  &happy {
    color: yellow
  }
  &angry {
    color: red
  }
  &sad {
    color: blue
  }
}
Run Code Online (Sandbox Code Playgroud)