styles.scss 1.56 KB
Newer Older
Tasso Evangelista's avatar
Tasso Evangelista committed
1 2 3
@import '../../helpers/mixins.scss';
@import '../../styles/theme.scss';

Tasso Evangelista's avatar
Tasso Evangelista committed
4 5 6 7 8 9 10 11 12 13 14 15 16
.rcx-text {
  $variants: get-token(typography);
  $color-variants: (
    default: get-token(colors, dark800),
    info: get-token(colors, dark700),
    hint: get-token(colors, dark600),
    disabled: get-token(colors, dark400),
    alternative: get-token(colors, 'white'),
    primary: get-token(colors, blue500),
    success: get-token(colors, green500),
    danger: get-token(colors, red500),
    warning: get-token(colors, yellow700),
  );
Tasso Evangelista's avatar
Tasso Evangelista committed
17

Tasso Evangelista's avatar
Tasso Evangelista committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
  @mixin variant($name) {
    $variant: map-get($variants, $name);
    $prefix: variant-#{$name};

    letter-spacing: var-theme(text, #{$prefix}-letter-spacing, to-rem(map-get($variant, letter-spacing)));

    font-family: var-theme(text, #{$prefix}-font-family, map-get($variant, font-family));
    font-size: var-theme(text, #{$prefix}-font-size, to-rem(map-get($variant, font-size)));
    font-weight: var-theme(text, #{$prefix}-font-weight, map-get($variant, font-weight));
    line-height: var-theme(text, #{$prefix}-line-height, to-rem(map-get($variant, line-height)));
  }

  @mixin color-variant($name) {
    $variant: map-get($color-variants, $name);
    $prefix: color-variant-#{$name};

    color: var-theme(text, #{$prefix}-color, $variant);
  }
Tasso Evangelista's avatar
Tasso Evangelista committed
36 37

  @include variant(p1);
Tasso Evangelista's avatar
Tasso Evangelista committed
38
  @include color-variant(default);
Tasso Evangelista's avatar
Tasso Evangelista committed
39

Tasso Evangelista's avatar
Tasso Evangelista committed
40
  @each $name in map-keys($variants) {
Tasso Evangelista's avatar
Tasso Evangelista committed
41 42 43 44
    &--variant-#{$name} {
      @include variant($name);
    }
  }
Tasso Evangelista's avatar
Tasso Evangelista committed
45 46 47 48 49 50

  @each $name in map-keys($color-variants) {
    &--color-variant-#{$name} {
      @include color-variant($name);
    }
  }
Tasso Evangelista's avatar
Tasso Evangelista committed
51
}
Tasso Evangelista's avatar
Tasso Evangelista committed
52 53

@include export-theme;