Open platform to collect and prioritize feedback
@use "sass:meta";
@mixin theme($theme-colors, $bodySelector) {
body#{$bodySelector} {
@each $name, $shades in $theme-colors {
@if meta.type-of($shades) == "map" {
@each $shade, $color in $shades {
.text-#{$name}-#{$shade} {
color: #{$color};
}
.hover\:text-#{$name}-#{$shade}:hover {
color: #{$color};
}
.bg-#{$name}-#{$shade} {
background-color: #{$color};
}
.hover\:bg-#{$name}-#{$shade}:hover {
background-color: #{$color};
}
.border-#{$name}-#{$shade} {
border-color: #{$color};
}
--colors-#{$name}-#{$shade}: #{$color};
}
} @else {
.text-#{$name} {
color: #{$shades};
}
.bg-#{$name} {
background-color: #{$shades};
}
.border-#{$name} {
border-color: #{$shades};
}
--colors-#{$name}: #{$shades};
}
}
}
}