mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
acf6ea74a7
* 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
41 lines
1.2 KiB
SCSS
41 lines
1.2 KiB
SCSS
// stylelint-disable custom-property-empty-line-before
|
|
|
|
// Base class
|
|
//
|
|
// Requires one of the contextual, color modifier classes for `color` and
|
|
// `background-color`.
|
|
|
|
.badge {
|
|
// scss-docs-start badge-css-vars
|
|
--#{$prefix}badge-padding-x: #{$badge-padding-x};
|
|
--#{$prefix}badge-padding-y: #{$badge-padding-y};
|
|
@include rfs($badge-font-size, --#{$prefix}badge-font-size);
|
|
--#{$prefix}badge-font-weight: #{$badge-font-weight};
|
|
--#{$prefix}badge-color: #{$badge-color};
|
|
--#{$prefix}badge-border-radius: #{$badge-border-radius};
|
|
// scss-docs-end badge-css-vars
|
|
|
|
display: inline-block;
|
|
padding: var(--#{$prefix}badge-padding-y) var(--#{$prefix}badge-padding-x);
|
|
font-size: var(--#{$prefix}badge-font-size);
|
|
font-weight: var(--#{$prefix}badge-font-weight);
|
|
line-height: 1;
|
|
color: var(--#{$prefix}badge-color);
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
vertical-align: baseline;
|
|
border-radius: var(--#{$prefix}badge-border-radius, 0); // stylelint-disable-line property-disallowed-list
|
|
@include gradient-bg();
|
|
|
|
// Empty badges collapse automatically
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// Quick fix for badges in buttons
|
|
.btn .badge {
|
|
position: relative;
|
|
top: -1px;
|
|
}
|