Skip to content

Commit e6d2ac8

Browse files
feat(mixins/label-class-variant()): add mixin for label class of a specified color name.
1 parent fdbe64b commit e6d2ac8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/mixins/_label.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// border-radius: $border-radius; // old spectre.css
88
border-radius: get-var('border-radius');
99
line-height: 1.25;
10-
padding: .1rem .2rem;
10+
padding: 0.1rem 0.2rem;
1111
}
1212

1313
// @mixin label-variant($color: $light-color, $bg-color: $primary-color) { // old spectre.css
@@ -18,7 +18,23 @@
1818
color: color($color);
1919
}
2020

21-
@mixin label--variant($color: color('light-color'), $bg-color: color('primary-color')) {
21+
@mixin label--variant(
22+
$color: color('light-color'),
23+
$bg-color: color('primary-color')
24+
) {
2225
color: $color;
2326
background: $bg-color;
2427
}
28+
29+
/*
30+
The mixin includes an extending class of name prefixed with `label-` with the given color `$name` that includes a label variant of the given `$color` and `$bg-color`.
31+
*/
32+
@mixin label-class-variant(
33+
$name: 'light',
34+
$color: 'light-color',
35+
$bg-color: 'primary-color',
36+
) {
37+
&.label-#{$name} {
38+
@include label-variant($color, $bg-color);
39+
}
40+
}

0 commit comments

Comments
 (0)