In Bulma, a lot of element share a set of styles. While mixins allow sharing, they repeat the CSS rules everytime they are used.
To avoid the repetition, Bulma uses the @extend
rule to share code. This rule tells Sass that one selector should inherit the styles of another. Learn more about the extend rule.
Instead of creating CSS classes that might not be used to be the source of the set of styles, Bulma uses Sass placeholders:
- {% include elements/snippet-inline.html content="%control" %}
- {% include elements/snippet-inline.html content="%unselectable" %}
- {% include elements/snippet-inline.html content="%arrow" %}
- {% include elements/snippet-inline.html content="%block" %}
- {% include elements/snippet-inline.html content="%delete" %}
- {% include elements/snippet-inline.html content="%loader" %}
- {% include elements/snippet-inline.html content="%overlay" %}
- {% include elements/snippet-inline.html content="%reset" %}
Each of these placeholders are simply the @extend
version of their corresponding mixins (here for the control mixin).