Skip to content

Commit 87ebe64

Browse files
refactor(mixins/toast): add new mixin toast-class-variant to have backward compatibility.
1 parent 0fb4a68 commit 87ebe64

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/mixins/_toast.scss

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
@use '../functions/color' as *;
22

33
// Toast variant mixin
4+
/*
5+
The mixin includes toast `background` and `border` of a given `$color`.
6+
*/
47
// @mixin toast-variant($color: $dark-color) { // old spectre.css
5-
@mixin toast-variant($name: 'dark', $color: 'dark-color') {
8+
@mixin toast-variant($color: 'dark-color') {
9+
// background: rgba($color, .95); // old spectre.css
10+
background: color($color, $alpha: 0.95);
11+
// border-color: $color; // old spectre.css
12+
border-color: color($color);
13+
}
14+
15+
/*
16+
The mixin includes an extension class of name prefixed with `toast-` with a given color name that includes a toast variant of the given `$color`.
17+
*/
18+
@mixin toast-class-variant($name: 'dark', $color: 'dark-color') {
619
&.toast-#{$name} {
7-
// background: rgba($color, .95); // old spectre.css
8-
background: color($color, $alpha: 0.95);
9-
// border-color: $color; // old spectre.css
10-
border-color: color($color);
20+
@include toast-variant($color);
1121
}
1222
}

0 commit comments

Comments
 (0)