
@use "functions" as _functions;
@use "variables" as _variables;
@use "breakpoints" as _bp;


// --------------------------------------------------------------------------
// Custom classes with responsive variants
// --------------------------------------------------------------------------

@if _variables.$s-custom-classes {

   @if type-of(_variables.$s-custom-classes) != "map" {
      @error "#{_variables.$s-custom-classes} in your config file is not a map.";
   }

   @each $breakpoint in map-keys(_variables.$s-breakpoints) {

      $prefix: _functions.breakpoint-prefix($breakpoint, _variables.$s-breakpoints);

      @each $class, $content in _variables.$s-custom-classes {

         @if type-of($content) != "map" {
            @error "#{$content} in your config file is not a map.";
         }
   
         @include _bp.media-up($breakpoint) {
            .#{$prefix}#{$class} { 
               @each $property, $value in $content { #{$property}: #{$value}; }
            }
         }
      }

   }

}