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

37 lines
619 B
Plaintext

{% codeExample 'example-if' %}
@use "sass:math";
@mixin avatar($size, $circle: false) {
width: $size;
height: $size;
@if $circle {
border-radius: math.div($size, 2);
}
}
.square-av {
@include avatar(100px, $circle: false);
}
.circle-av {
@include avatar(100px, $circle: true);
}
===
@use "sass:math"
@mixin avatar($size, $circle: false)
width: $size
height: $size
@if $circle
border-radius: math.div($size, 2)
.square-av
@include avatar(100px, $circle: false)
.circle-av
@include avatar(100px, $circle: true)
{% endcodeExample %}