'%' in SASS, what does it mean

前端 未结 3 1115
旧巷少年郎
旧巷少年郎 2020-12-05 18:15

I saw this code, when i was checking Drupal Omega 4 theme

 %container {
  @include container;
  @include grid-background;
}

what does the \

3条回答
  •  借酒劲吻你
    2020-12-05 18:45

    Placeholder Selectors: %foo

    Sass supports a special type of selector called a “placeholder selector”. These look like class and id selectors, except the # or . is replaced by %. They’re meant to be used with the @extend directive; for more information see @extend-Only Selectors.

    On their own, without any use of @extend, rulesets that use placeholder selectors will not be rendered to CSS.

    http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#placeholder_selectors_foo

提交回复
热议问题