sass-site/source/code-snippets/_example-if-parent-selector.html.erb

27 lines
513 B
Plaintext
Raw Normal View History

2018-09-01 22:35:20 +02:00
<% example do %>
@mixin app-background($color) {
#{if(&, '&.app-background', '.app-background')} {
background-color: $color;
color: rgba(#fff, 0.75);
}
2018-09-01 22:35:20 +02:00
}
@include app-background(#036);
2018-09-01 22:35:20 +02:00
.sidebar {
@include app-background(#c6538c);
}
===
@mixin app-background($color)
#{if(&, '&.app-background', '.app-background')}
background-color: $color
color: rgba(#fff, 0.75)
2018-09-01 22:35:20 +02:00
@include app-background(#036)
2018-09-01 22:35:20 +02:00
.sidebar
@include app-background(#c6538c)
2018-09-01 22:35:20 +02:00
<% end %>