Css 嵌套多个类的Sass

Css 嵌套多个类的Sass,css,sass,Css,Sass,好的,这就是我想要实现的: .about{ /* some styling */ } .about,.about-pg{ /* other styling */ } 我想我可以用Sass .about /* some styling */ &,.about-pg /* other styling */ 然而,它编译为: .about{ /* some styling */ } .about,.about .about-pg{ /* other styl

好的,这就是我想要实现的:

.about{
  /* some styling */
}
.about,.about-pg{
  /* other styling */
}
我想我可以用Sass

.about
  /* some styling */
  &,.about-pg
    /* other styling */
然而,它编译为:

.about{
  /* some styling */
}
.about,.about .about-pg{
  /* other styling */
}

有什么线索可以解释为什么以及如何解决这个问题吗?

使用
@extend

.about
  /* some styling */
  @extend .about-pg

.about-pg
  /* other styling */

也许使用变量?@FelipeAls,那该怎么办?主要的问题是Sass引入了另一个——在本例中是——’。关于‘我不想要它的地方。@cimmanon的可能副本他使用了同一段代码,是的。然而,它并没有正确编译。。。