@mixin generate-utility($utility, $infix: "") {
  $values: map-get($utility, values);
  $properties: map-get($utility, property);
  $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
  $css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class));
  $is-css-var: map-get($utility, css-var);
  $is-local-vars: map-get($utility, local-vars);

  // Only process color-related utilities
  @if map-get($utility, color) or 
      $property-class == "text" or 
      $property-class == "bg" or 
      $property-class == "border" {

    @each $key, $value in $values {
      @if $is-css-var {
        .#{$property-class + $infix}-#{$key} {
          --#{$prefix}#{$css-variable-name}: #{$value};
        }
      } @else {
        .#{$property-class + $infix}-#{$key} {
          @each $property in $properties {
            #{$property}: $value;
          }
        }
      }
    }
  }
}