什么';这是在SASS中处理伪选择器的最佳方法

什么';这是在SASS中处理伪选择器的最佳方法,sass,Sass,只是想了解一些最佳实践/技巧。谢谢。字符将允许您在声明中引用父选择器。例如: a { font-weight: bold; text-decoration: none; &:hover { text-decoration: underline; } body.firefox & { font-weight: normal; } } 汇编为: a { font-weight: bold; text-decoration: none; } a:hover

只是想了解一些最佳实践/技巧。谢谢。

字符将允许您在声明中引用父选择器。例如:

a {
  font-weight: bold;
  text-decoration: none;
  &:hover { text-decoration: underline; }
  body.firefox & { font-weight: normal; }
}
汇编为:

a {
  font-weight: bold;
  text-decoration: none; }
  a:hover {
     text-decoration: underline; }
  body.firefox a {
    font-weight: normal; }
资料来源: