@function set-theme-vars($t) {
    @return map-merge(
        $t,
        (
            muted-color:
                mix(
                    map-get($t, medium-color),
                    map-get($t, background-color),
                    map-get($t, mute-percent)
                ),
            muted-color-border:
                mix(
                    map-get($t, medium-color),
                    map-get($t, background-color),
                    semi-mute-percent(map-get($t, mute-percent))
                ),
            text-selection-bg-color: rgba(map-get($t, action-color), 0.3),
            text-selection-bg-color-error: rgba(map-get($t, error-color), 0.8),
            text-semi-muted-color: mix(map-get($t, action-color), map-get($t, text-color), 0.5),
            text-contrast-action-color:
                text-contrast-color(
                    map-get($t, action-color),
                    map-get($t, color-lightness-shift),
                    map-get($t, background-color),
                    map-get($t, text-color)
                ),
            text-contrast-error-color:
                text-contrast-color(
                    map-get($t, error-color),
                    map-get($t, color-lightness-shift),
                    map-get($t, background-color),
                    map-get($t, text-color)
                ),
            base-border-color: mix(map-get($t, medium-color), map-get($t, background-color), 50%),
            accent-border-color: mix(map-get($t, medium-color), map-get($t, background-color), 65%),
            light-border-color:
                mix(
                    map-get($t, medium-color),
                    map-get($t, background-color),
                    map-get($t, light-border-percent)
                ),
            form-box-border-focus: map-get($t, action-color),
            form-box-shadow-color-focus: lightness-alpha(map-get($t, action-color), -5%, -0.3),
            form-box-shadow-color-focus-error: lightness-alpha(map-get($t, error-color), -5%, -0.3),
            dropdown-box-shadow-color: rgba(map-get($t, medium-color), 0.05),
            secondary-background-color:
                mix(map-get($t, medium-color), map-get($t, background-color), 10%),
            intermediate-background-color:
                mix(map-get($t, medium-color), map-get($t, background-color), 3%),
            intermediate-pressed-background-color:
                mix(map-get($t, medium-color), map-get($t, background-color), 2.6%),
            disabled-background-color: shade(map-get($t, background-color), 5%),
            action-background-color-focus: shade(map-get($t, action-color), 20%),
            action-background-color-focus-tr: rgba(shade(map-get($t, action-color), 20%), 0.1),
            error-background-color-focus: shade(map-get($t, error-color), 20%),
            error-background-color-focus-tr: rgba(shade(map-get($t, error-color), 20%), 0.1),
            action-background-color-active: shade(map-get($t, action-color), 25%),
            action-background-color-active-tr: rgba(shade(map-get($t, action-color), 25%), 0.15),
            error-background-color-active: shade(map-get($t, error-color), 25%),
            error-background-color-active-tr: rgba(shade(map-get($t, error-color), 25%), 0.15),
            modal-background-color: rgba(map-get($t, background-color), map-get($t, modal-opacity)),
            modal-background-color-tr: rgba(map-get($t, background-color), 0)
        )
    );
}
