@use 'sass:math';

/* First set with named sizes */
.text-, .text-- {
  &xsm { font-size: 0.2rem; }
  &xs  { font-size: 0.4rem; }
  &s   { font-size: 0.8rem; }
  &n, &normal, &general { font-size: 1rem; }
  &m   { font-size: 1.2rem; }
  &l   { font-size: 1.4rem; }
  &xl  { font-size: 1.8rem; }
  &xxl { font-size: 2rem; }
  &xxxl { font-size: 2.5rem; }
}

/* Numeric sizes using loop */
@for $i from 0 through 500 {
  // Convert to decimal using math.div
  $value: math.div($i, 10);
  
  // For numbers 0-9, generate with leading zero
  @if $i < 10 {
    .text--0#{$i}, .text-0#{$i} {
      font-size: #{$value}rem;
    }
  }
  
  // For all numbers, generate without leading zero
  .text--#{$i}, .text-#{$i} {
    font-size: #{$value}rem;
  }
}