Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

1011 B
Raw Blame
@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};
      }
    }
  }
}