graycoreio/daffodil

View on GitHub
libs/design/button/src/button-theme-variants/button.scss

Summary

Maintainability
Test Coverage
@use '../../../scss/theming';

@mixin daff-button-theme-variant(
    $base-color,
    $hover-color,
    $active-color: $hover-color
) {
    background-color: $base-color;
    color: theming.daff-text-contrast($base-color);

    &:after {
        background: $hover-color;
    }

    &:hover {
        color: theming.daff-text-contrast($hover-color);
    }

    &:active {
        color: theming.daff-text-contrast($active-color);

        &:after {
            background: $active-color;
        }
    }
}