@use 'sass:map';
@use 'sass:string';
@use 'breakpoint';
@use '@tokens' as tokens;

@mixin generate($token) {
    @each $breakpoint-name, $breakpoint-value in tokens.$breakpoints {
        @include breakpoint.up($breakpoint-value) {
            @if map.has-key($token, $breakpoint-name, font-style) {
                font-style: map.get($token, $breakpoint-name, font-style);
            }

            @if map.has-key($token, $breakpoint-name, font-weight) {
                font-weight: map.get($token, $breakpoint-name, font-weight);
            }

            @if map.has-key($token, $breakpoint-name, font-size) {
                font-size: map.get($token, $breakpoint-name, font-size);
            }

            @if map.has-key($token, $breakpoint-name, line-height) {
                line-height: map.get($token, $breakpoint-name, line-height);
            }

            @if map.has-key($token, $breakpoint-name, font-family) {
                font-family: string.unquote(map.get($token, $breakpoint-name, font-family));
            }

            @if map.has-key($token, $breakpoint-name, letter-spacing) {
                letter-spacing: map.get($token, $breakpoint-name, letter-spacing);
            }

            @if map.has-key($token, $breakpoint-name, text-decoration) {
                text-decoration: map.get($token, $breakpoint-name, text-decoration);
            }

            @if map.has-key($token, $breakpoint-name, text-transform) {
                text-transform: map.get($token, $breakpoint-name, text-transform);
            }

            @if map.has-key($token, $breakpoint-name, text-indent) {
                text-indent: map.get($token, $breakpoint-name, text-indent);
            }
        }
    }
}
