1

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

.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 */
}

任何线索为什么以及如何解决这个问题?

4

1 回答 1

0

使用@extend

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

.about-pg
  /* other styling */
于 2013-08-02T12:32:22.937 回答