2023-05-30 11:56:49 +02:00
|
|
|
{% codeExample 'example-if' %}
|
2023-05-31 13:45:19 -04:00
|
|
|
@use "sass:math";
|
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
@mixin avatar($size, $circle: false) {
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
2023-05-30 11:56:49 +02:00
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
@if $circle {
|
2023-05-31 13:45:19 -04:00
|
|
|
border-radius: math.div($size, 2);
|
2023-05-30 17:23:34 -04:00
|
|
|
}
|
2023-05-30 11:56:49 +02:00
|
|
|
}
|
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
.square-av {
|
|
|
|
@include avatar(100px, $circle: false);
|
|
|
|
}
|
|
|
|
.circle-av {
|
|
|
|
@include avatar(100px, $circle: true);
|
|
|
|
}
|
|
|
|
===
|
2023-05-31 14:03:30 -04:00
|
|
|
@use "sass:math"
|
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
@mixin avatar($size, $circle: false)
|
|
|
|
width: $size
|
|
|
|
height: $size
|
2023-05-30 11:56:49 +02:00
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
@if $circle
|
2023-05-31 13:45:19 -04:00
|
|
|
border-radius: math.div($size, 2)
|
2023-05-30 11:56:49 +02:00
|
|
|
|
2023-05-31 14:11:29 -04:00
|
|
|
|
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
.square-av
|
|
|
|
@include avatar(100px, $circle: false)
|
2023-05-31 14:11:29 -04:00
|
|
|
|
2023-05-30 17:23:34 -04:00
|
|
|
.circle-av
|
|
|
|
@include avatar(100px, $circle: true)
|
2023-05-30 11:56:49 +02:00
|
|
|
{% endcodeExample %}
|