@mixin matcha-cards-theme($theme) {
    $color-functions: (
        red: getRed,
        pink: getPink,
        purple: getPurple,
        deep-purple: getDeepPurple,
        indigo: getIndigo,
        blue: getBlue,
        light-blue: getLightBlue,
        cyan: getCyan,
        teal: getTeal,
        green: getGreen,
        light-green: getLightGreen,
        lime: getLime,
        yellow: getYellow,
        amber: getAmber,
        orange: getOrange,
        deep-orange: getDeepOrange,
        brown: getBrown,
        grey: getGrey,
        blue-grey: getBlueGrey,
        primary: getPrimary,
        accent: getAccent,
        success: getSuccess,
        warn: getWarn,
        danger: getDanger,
        info: getInfo,
        disabled: getDisabled,
    );

matcha-card,
.matcha-card,
.matcha-card-flat {
    @each $colorName, $colorFn in $color-functions {
        &[color="#{'' + $colorName}"][tint]:not([tint="false"]) {
            background: call(#{$colorFn}Alpha, $theme);
            color: call(#{$colorFn}, $theme);
        }

        &[color="#{'' + $colorName}"][outline]:not([outline="false"]),
        &[color="#{'' + $colorName}"][link]:not([link="false"]),
        &[color="#{'' + $colorName}"][basic]:not([basic="false"]) {
            color: call(#{$colorFn}, $theme);
        }

        &[color="#{'' + $colorName}"] {
            background: call(#{$colorFn}, $theme);
            color: call(#{$colorFn}Contrast, $theme);

            &[alpha]:not([alpha="false"]) {
                background: call(#{$colorFn}Alpha, $theme);
                color: getForeground($theme);
            }
        }
    }


    &[basic]:not([basic="false"]) {
        box-shadow: 0px 0px 0px 0px inset;
    }

    &[link]:not([link="false"]) {
        text-transform: initial;
        letter-spacing: 0;
        text-decoration: none;
        padding: 0;
    }

    &[basic="true"]:not([icon="false"]) {
        border: 0px solid currentColor;
        background: getSurface($theme);

        &:not([color]) {
            border-color: getForeground($theme);
            background: transparent !important;
        }

        &[color]:not([outline]) {
            background: getSurface($theme) !important;
        }
    }

    &[outline]:not([outline="false"]) {
        box-shadow: 0px 0px 0px 2px inset;
        border: 0px solid currentColor;
        background: transparent !important;

        &:not([color]) {
            border-color: getForeground($theme);
            color: getForeground($theme);
        }
    }

    &:not([color]) {
        background: getSurface($theme);
        color: getForeground($theme);
    }



    // bg
    &[color="bg"][alpha]:not([alpha="false"]) {
        background: getBackgroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="bg"][tint]:not([tint="false"]) {
        background: getBackgroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="bg"][outline]:not([outline="false"]),
    &[color="bg"][link]:not([link="false"]),
    &[color="bg"][basic]:not([basic="false"]) {
        color: getForeground($theme);
    }

    &[color="bg"] {
        background: getBackground($theme);
        color: getForeground($theme);
    }

    // surface
    &[color="surface"][alpha]:not([alpha="false"]) {
        background: getSurfaceAlpha($theme);
        color: getForeground($theme);
    }

    &[color="surface"][tint]:not([tint="false"]) {
        background: getSurfaceAlpha($theme);
        color: getForeground($theme);
    }

    &[color="surface"][outline]:not([outline="false"]),
    &[color="surface"][link]:not([link="false"]),
    &[color="surface"][basic]:not([basic="false"]) {
        color: getForeground($theme);
    }

    &[color="surface"] {
        background: getSurface($theme);
        color: getForeground($theme);
    }

    // fg
    &[color="fg"][alpha]:not([alpha="false"]) {
        background: getForegroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="fg"][tint]:not([tint="false"]) {
        background: getForegroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="fg"][outline]:not([outline="false"]),
    &[color="fg"][link]:not([link="false"]),
    &[color="fg"][basic]:not([basic="false"]) {
        color: getForeground($theme);
    }

    &[color="fg"] {
        background: getForeground($theme);
        color: getForegroundInverse($theme);
    }

    //basic
    &[color="basic"][alpha]:not([alpha="false"]) {
        background: getForegroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="basic"][tint]:not([tint="false"]) {
        background: getForegroundAlpha($theme);
        color: getForeground($theme);
    }

    &[color="basic"][outline]:not([outline="false"]),
    &[color="basic"][link]:not([link="false"]),
    &[color="basic"][basic]:not([basic="false"]) {
        color: getForeground($theme);
    }

    &[color="basic"] {
        background: getSurface($theme);
        color: getForeground($theme);
    }

    &[color="basic"] {
        background: getSurface($theme);

        &:not([color]) {
            color: getForeground($theme);
        }
    }
}
}

// -----------------------------------------------------------------------------------------------------
// @ Cards
// -----------------------------------------------------------------------------------------------------
matcha-card,
.matcha-card,
.matcha-card-flat {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;

    &-border,
    &-border-left {
        border-left: 8px solid;
    }

    &-border-right {
        border-right: 8px solid;
    }

    &.disabled {
        transition: opacity 100ms linear;
        opacity: 0.5;
        pointer-events: none;
    }

    &.enabled {
        transition: opacity 100ms linear;
        opacity: 1;
    }

    &.variable-width {
        min-width: 0;
    }

    &.auto-width {
        min-width: 0;
        max-width: none;
    }

    &.fixed-width {
        min-width: 264px;
        max-width: 264px;
        width: 264px;
    }

    // Buttons
    .mat-button {
        min-width: 0 !important;
        padding: 0 8px !important;
    }

    // Button Toggle Group
    .mat-button-toggle-group,
    .mat-button-toggle-standalone {
        box-shadow: none !important;
    }

    .mat-tab-label {
        min-width: 0 !important;
    }

    // Divider
    .card-divider {
        margin: 16px;

        &.full-width {
            margin: 0;
        }
    }

    // Expand Area
    .card-expand-area {
        overflow: hidden;

        .card-expanded-content {
            padding: 8px 16px 16px 16px;
            line-height: 1.75;
        }
    }
}