sass-site/source/code-snippets/example-if.liquid

30 lines
557 B
Plaintext
Raw Normal View History

{% codeExample 'example-if' %}
2023-05-30 23:23:34 +02:00
@mixin avatar($size, $circle: false) {
width: $size;
height: $size;
2023-05-30 23:23:34 +02:00
@if $circle {
border-radius: $size / 2;
}
}
2023-05-30 23:23:34 +02:00
.square-av {
@include avatar(100px, $circle: false);
}
.circle-av {
@include avatar(100px, $circle: true);
}
===
@mixin avatar($size, $circle: false)
width: $size
height: $size
2023-05-30 23:23:34 +02:00
@if $circle
border-radius: $size / 2
2023-05-30 23:23:34 +02:00
.square-av
@include avatar(100px, $circle: false)
.circle-av
@include avatar(100px, $circle: true)
{% endcodeExample %}