My custom token component
My custom token component
Code
$default-custom-theme: map-merge(
$carbon--theme--white,
(
custom-token-01: #171717,
)
);
$custom-token-01: map-get(
$default-custom-theme,
custom-token-01
) !default !global;
@mixin my-custom-token-component() {
.my-custom-token-component {
color: $interactive-01;
}
.my-custom-token-component .custom-token {
color: $custom-token-01;
}
}
@include my-custom-token-component();
@mixin custom-theme($theme: $default-custom-theme) {
@include carbon--theme($theme) {
$custom-token-01: map-get($theme, custom-token-01) !global;
@content;
}
@if $theme != $default-custom-theme {
@include custom-theme($default-custom-theme);
}
}
$custom-theme: map-merge(
$default-custom-theme,
(
interactive-01: #ee538b,
custom-token-01: #8a3ffc,
)
);
.theme {
@include custom-theme($custom-theme) {
@include my-custom-token-component();
}
}