2014-12-02 17:02:35 -05:00
|
|
|
// Button variants
|
|
|
|
//
|
|
|
|
// Easily pump out default styles, as well as :hover, :focus, :active,
|
|
|
|
// and disabled options for all buttons
|
|
|
|
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-start btn-variant-mixin
|
2019-10-12 04:21:22 -04:00
|
|
|
@mixin button-variant(
|
|
|
|
$background,
|
|
|
|
$border,
|
2020-03-23 13:03:56 -04:00
|
|
|
$color: color-contrast($background),
|
2020-12-17 00:16:54 -05:00
|
|
|
$hover-background: if($color == $color-contrast-light, shade-color($background, $btn-hover-bg-shade-amount), tint-color($background, $btn-hover-bg-tint-amount)),
|
|
|
|
$hover-border: if($color == $color-contrast-light, shade-color($border, $btn-hover-border-shade-amount), tint-color($border, $btn-hover-border-tint-amount)),
|
2020-03-23 13:03:56 -04:00
|
|
|
$hover-color: color-contrast($hover-background),
|
2021-05-18 19:47:45 -04:00
|
|
|
$active-background: if($color == $color-contrast-light, shade-color($background, $btn-active-bg-shade-amount), tint-color($background, $btn-active-bg-tint-amount)),
|
2020-12-17 00:16:54 -05:00
|
|
|
$active-border: if($color == $color-contrast-light, shade-color($border, $btn-active-border-shade-amount), tint-color($border, $btn-active-border-tint-amount)),
|
2020-07-12 00:56:33 -04:00
|
|
|
$active-color: color-contrast($active-background),
|
|
|
|
$disabled-background: $background,
|
|
|
|
$disabled-border: $border,
|
|
|
|
$disabled-color: color-contrast($disabled-background)
|
2019-10-12 04:21:22 -04:00
|
|
|
) {
|
Add additional root variables, rename `$variable-prefix` to `$prefix` (#35981)
* Add additional root variables, rename $variable-prefix to $prefix
- Adds new root CSS variables for border-radius, border-width, border-color, and border-style
- Adds new root CSS variables for heading-color, link-colors, code color, and highlight color
- Replaces most instances of Sass variables (for border-radius, border-color, border-style, and border-width) for CSS variables inside _variables.scss
- Updates $mark-padding to be an even pixel number
- Renames $variable-prefix to $prefix throughout
* Bundlewatch
2022-03-13 13:13:09 -04:00
|
|
|
--#{$prefix}btn-color: #{$color};
|
|
|
|
--#{$prefix}btn-bg: #{$background};
|
|
|
|
--#{$prefix}btn-border-color: #{$border};
|
|
|
|
--#{$prefix}btn-hover-color: #{$hover-color};
|
|
|
|
--#{$prefix}btn-hover-bg: #{$hover-background};
|
|
|
|
--#{$prefix}btn-hover-border-color: #{$hover-border};
|
|
|
|
--#{$prefix}btn-focus-shadow-rgb: #{to-rgb(mix($color, $border, 15%))};
|
|
|
|
--#{$prefix}btn-active-color: #{$active-color};
|
|
|
|
--#{$prefix}btn-active-bg: #{$active-background};
|
|
|
|
--#{$prefix}btn-active-border-color: #{$active-border};
|
|
|
|
--#{$prefix}btn-active-shadow: #{$btn-active-box-shadow};
|
|
|
|
--#{$prefix}btn-disabled-color: #{$disabled-color};
|
|
|
|
--#{$prefix}btn-disabled-bg: #{$disabled-background};
|
|
|
|
--#{$prefix}btn-disabled-border-color: #{$disabled-border};
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-end btn-variant-mixin
|
2014-12-02 17:02:35 -05:00
|
|
|
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-start btn-outline-variant-mixin
|
2019-10-12 04:21:22 -04:00
|
|
|
@mixin button-outline-variant(
|
|
|
|
$color,
|
2020-03-23 13:03:56 -04:00
|
|
|
$color-hover: color-contrast($color),
|
2019-10-12 04:21:22 -04:00
|
|
|
$active-background: $color,
|
|
|
|
$active-border: $color,
|
2020-03-23 13:03:56 -04:00
|
|
|
$active-color: color-contrast($active-background)
|
2019-10-12 04:21:22 -04:00
|
|
|
) {
|
Add additional root variables, rename `$variable-prefix` to `$prefix` (#35981)
* Add additional root variables, rename $variable-prefix to $prefix
- Adds new root CSS variables for border-radius, border-width, border-color, and border-style
- Adds new root CSS variables for heading-color, link-colors, code color, and highlight color
- Replaces most instances of Sass variables (for border-radius, border-color, border-style, and border-width) for CSS variables inside _variables.scss
- Updates $mark-padding to be an even pixel number
- Renames $variable-prefix to $prefix throughout
* Bundlewatch
2022-03-13 13:13:09 -04:00
|
|
|
--#{$prefix}btn-color: #{$color};
|
|
|
|
--#{$prefix}btn-border-color: #{$color};
|
|
|
|
--#{$prefix}btn-hover-color: #{$color-hover};
|
|
|
|
--#{$prefix}btn-hover-bg: #{$active-background};
|
|
|
|
--#{$prefix}btn-hover-border-color: #{$active-border};
|
|
|
|
--#{$prefix}btn-focus-shadow-rgb: #{to-rgb($color)};
|
|
|
|
--#{$prefix}btn-active-color: #{$active-color};
|
|
|
|
--#{$prefix}btn-active-bg: #{$active-background};
|
|
|
|
--#{$prefix}btn-active-border-color: #{$active-border};
|
|
|
|
--#{$prefix}btn-active-shadow: #{$btn-active-box-shadow};
|
|
|
|
--#{$prefix}btn-disabled-color: #{$color};
|
|
|
|
--#{$prefix}btn-disabled-bg: transparent;
|
|
|
|
--#{$prefix}gradient: none;
|
2015-08-10 02:45:36 -04:00
|
|
|
}
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-end btn-outline-variant-mixin
|
2015-08-10 02:45:36 -04:00
|
|
|
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-start btn-size-mixin
|
2019-08-30 03:42:41 -04:00
|
|
|
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
|
Add additional root variables, rename `$variable-prefix` to `$prefix` (#35981)
* Add additional root variables, rename $variable-prefix to $prefix
- Adds new root CSS variables for border-radius, border-width, border-color, and border-style
- Adds new root CSS variables for heading-color, link-colors, code color, and highlight color
- Replaces most instances of Sass variables (for border-radius, border-color, border-style, and border-width) for CSS variables inside _variables.scss
- Updates $mark-padding to be an even pixel number
- Renames $variable-prefix to $prefix throughout
* Bundlewatch
2022-03-13 13:13:09 -04:00
|
|
|
--#{$prefix}btn-padding-y: #{$padding-y};
|
|
|
|
--#{$prefix}btn-padding-x: #{$padding-x};
|
|
|
|
@include rfs($font-size, --#{$prefix}btn-font-size);
|
|
|
|
--#{$prefix}btn-border-radius: #{$border-radius};
|
2014-12-02 17:02:35 -05:00
|
|
|
}
|
2021-02-10 22:29:59 -05:00
|
|
|
// scss-docs-end btn-size-mixin
|