sass-site/source/_includes/code_snippets/example-if-parent-selector.liquid
2023-06-02 18:18:43 -04:00

27 lines
546 B
Plaintext

{% codeExample 'if-parent-selector' %}
@mixin app-background($color) {
#{if(&, '&.app-background', '.app-background')} {
background-color: $color;
color: rgba(#fff, 0.75);
}
}
@include app-background(#036);
.sidebar {
@include app-background(#c6538c);
}
===
@mixin app-background($color)
#{if(&, '&.app-background', '.app-background')}
background-color: $color
color: rgba(#fff, 0.75)
@include app-background(#036)
.sidebar
@include app-background(#c6538c)
{% endcodeExample %}