2024-07-29 22:04:11 -07:00
|
|
|
@use "sass:color";
|
|
|
|
@use "../functions";
|
|
|
|
@use "../variables";
|
|
|
|
@use "../vendor/rfs";
|
|
|
|
|
2014-12-02 14:02:35 -08:00
|
|
|
// Button variants
|
|
|
|
//
|
|
|
|
// Easily pump out default styles, as well as :hover, :focus, :active,
|
|
|
|
// and disabled options for all buttons
|
|
|
|
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-start btn-variant-mixin
|
2019-10-12 08:21:22 +00:00
|
|
|
@mixin button-variant(
|
|
|
|
$background,
|
|
|
|
$border,
|
2024-07-29 22:04:11 -07:00
|
|
|
$color: functions.color-contrast($background),
|
|
|
|
$hover-background: if($color == variables.$color-contrast-light, functions.shade-color($background, variables.$btn-hover-bg-shade-amount), functions.tint-color($background, variables.$btn-hover-bg-tint-amount)),
|
|
|
|
$hover-border: if($color == variables.$color-contrast-light, functions.shade-color($border, variables.$btn-hover-border-shade-amount), functions.tint-color($border, variables.$btn-hover-border-tint-amount)),
|
|
|
|
$hover-color: functions.color-contrast($hover-background),
|
|
|
|
$active-background: if($color == variables.$color-contrast-light, functions.shade-color($background, variables.$btn-active-bg-shade-amount), functions.tint-color($background, variables.$btn-active-bg-tint-amount)),
|
|
|
|
$active-border: if($color == variables.$color-contrast-light, functions.shade-color($border, variables.$btn-active-border-shade-amount), functions.tint-color($border, variables.$btn-active-border-tint-amount)),
|
|
|
|
$active-color: functions.color-contrast($active-background),
|
2020-07-12 06:56:33 +02:00
|
|
|
$disabled-background: $background,
|
|
|
|
$disabled-border: $border,
|
2024-07-29 22:04:11 -07:00
|
|
|
$disabled-color: functions.color-contrast($disabled-background)
|
2019-10-12 08:21:22 +00:00
|
|
|
) {
|
2024-07-29 22:04:11 -07:00
|
|
|
--#{variables.$prefix}btn-color: #{$color};
|
|
|
|
--#{variables.$prefix}btn-bg: #{$background};
|
|
|
|
--#{variables.$prefix}btn-border-color: #{$border};
|
|
|
|
--#{variables.$prefix}btn-hover-color: #{$hover-color};
|
|
|
|
--#{variables.$prefix}btn-hover-bg: #{$hover-background};
|
|
|
|
--#{variables.$prefix}btn-hover-border-color: #{$hover-border};
|
|
|
|
--#{variables.$prefix}btn-focus-shadow-rgb: #{functions.to-rgb(color.mix($color, $border, 15%))};
|
|
|
|
--#{variables.$prefix}btn-active-color: #{$active-color};
|
|
|
|
--#{variables.$prefix}btn-active-bg: #{$active-background};
|
|
|
|
--#{variables.$prefix}btn-active-border-color: #{$active-border};
|
|
|
|
--#{variables.$prefix}btn-active-shadow: #{variables.$btn-active-box-shadow};
|
|
|
|
--#{variables.$prefix}btn-disabled-color: #{$disabled-color};
|
|
|
|
--#{variables.$prefix}btn-disabled-bg: #{$disabled-background};
|
|
|
|
--#{variables.$prefix}btn-disabled-border-color: #{$disabled-border};
|
2014-12-02 14:02:35 -08:00
|
|
|
}
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-end btn-variant-mixin
|
2014-12-02 14:02:35 -08:00
|
|
|
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-start btn-outline-variant-mixin
|
2019-10-12 08:21:22 +00:00
|
|
|
@mixin button-outline-variant(
|
|
|
|
$color,
|
2024-07-29 22:04:11 -07:00
|
|
|
$color-hover: functions.color-contrast($color),
|
2019-10-12 08:21:22 +00:00
|
|
|
$active-background: $color,
|
|
|
|
$active-border: $color,
|
2024-07-29 22:04:11 -07:00
|
|
|
$active-color: functions.color-contrast($active-background)
|
2019-10-12 08:21:22 +00:00
|
|
|
) {
|
2024-07-29 22:04:11 -07:00
|
|
|
--#{variables.$prefix}btn-color: #{$color};
|
|
|
|
--#{variables.$prefix}btn-border-color: #{$color};
|
|
|
|
--#{variables.$prefix}btn-hover-color: #{$color-hover};
|
|
|
|
--#{variables.$prefix}btn-hover-bg: #{$active-background};
|
|
|
|
--#{variables.$prefix}btn-hover-border-color: #{$active-border};
|
|
|
|
--#{variables.$prefix}btn-focus-shadow-rgb: #{functions.to-rgb($color)};
|
|
|
|
--#{variables.$prefix}btn-active-color: #{$active-color};
|
|
|
|
--#{variables.$prefix}btn-active-bg: #{$active-background};
|
|
|
|
--#{variables.$prefix}btn-active-border-color: #{$active-border};
|
|
|
|
--#{variables.$prefix}btn-active-shadow: #{variables.$btn-active-box-shadow};
|
|
|
|
--#{variables.$prefix}btn-disabled-color: #{$color};
|
|
|
|
--#{variables.$prefix}btn-disabled-bg: transparent;
|
|
|
|
--#{variables.$prefix}btn-disabled-border-color: #{$color};
|
|
|
|
--#{variables.$prefix}gradient: none;
|
2015-08-09 23:45:36 -07:00
|
|
|
}
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-end btn-outline-variant-mixin
|
2015-08-09 23:45:36 -07:00
|
|
|
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-start btn-size-mixin
|
2019-08-30 09:42:41 +02:00
|
|
|
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
|
2024-07-29 22:04:11 -07:00
|
|
|
--#{variables.$prefix}btn-padding-y: #{$padding-y};
|
|
|
|
--#{variables.$prefix}btn-padding-x: #{$padding-x};
|
|
|
|
@include rfs.rfs($font-size, --#{variables.$prefix}btn-font-size);
|
|
|
|
--#{variables.$prefix}btn-border-radius: #{$border-radius};
|
2014-12-02 14:02:35 -08:00
|
|
|
}
|
2021-02-10 19:29:59 -08:00
|
|
|
// scss-docs-end btn-size-mixin
|