First pass at CSS layers (#41701)

* First pass at CSS layers

* bundlewatch

* more bundlewatch
This commit is contained in:
Mark Otto 2025-08-28 12:47:04 -07:00 committed by Mark Otto
parent 009d985d82
commit e9c0a25323
48 changed files with 4551 additions and 4472 deletions

View File

@ -10,15 +10,15 @@
},
{
"path": "./dist/css/bootstrap-reboot.css",
"maxSize": "4.25 kB"
"maxSize": "4.5 kB"
},
{
"path": "./dist/css/bootstrap-reboot.min.css",
"maxSize": "4.25 kB"
"maxSize": "4.5 kB"
},
{
"path": "./dist/css/bootstrap-utilities.css",
"maxSize": "12.75 kB"
"maxSize": "13.0 kB"
},
{
"path": "./dist/css/bootstrap-utilities.min.css",
@ -26,7 +26,7 @@
},
{
"path": "./dist/css/bootstrap.css",
"maxSize": "33.75 kB"
"maxSize": "34.0 kB"
},
{
"path": "./dist/css/bootstrap.min.css",

View File

@ -11,7 +11,8 @@
// Base styles
//
.accordion {
@layer componenents {
.accordion {
// scss-docs-start accordion-css-vars
--#{$prefix}accordion-color: #{$accordion-color};
--#{$prefix}accordion-bg: #{$accordion-bg};
@ -35,9 +36,9 @@
--#{$prefix}accordion-active-color: #{$accordion-button-active-color};
--#{$prefix}accordion-active-bg: #{$accordion-button-active-bg};
// scss-docs-end accordion-css-vars
}
}
.accordion-button {
.accordion-button {
position: relative;
display: flex;
align-items: center;
@ -85,13 +86,13 @@
outline: 0;
box-shadow: var(--#{$prefix}accordion-btn-focus-box-shadow);
}
}
}
.accordion-header {
.accordion-header {
margin-bottom: 0;
}
}
.accordion-item {
.accordion-item {
color: var(--#{$prefix}accordion-color);
background-color: var(--#{$prefix}accordion-bg);
border: var(--#{$prefix}accordion-border-width) solid var(--#{$prefix}accordion-border-color);
@ -122,18 +123,18 @@
@include border-bottom-radius(var(--#{$prefix}accordion-border-radius));
}
}
}
}
.accordion-body {
.accordion-body {
padding: var(--#{$prefix}accordion-body-padding-y) var(--#{$prefix}accordion-body-padding-x);
}
}
// Flush accordion items
//
// Remove borders and border-radius to keep accordion items edge-to-edge.
// Flush accordion items
//
// Remove borders and border-radius to keep accordion items edge-to-edge.
.accordion-flush {
.accordion-flush {
> .accordion-item {
border-right: 0;
border-left: 0;
@ -150,13 +151,14 @@
}
// stylelint-enable selector-max-class
}
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark) {
.accordion-button::after {
--#{$prefix}accordion-btn-icon: #{escape-svg($accordion-button-icon-dark)};
--#{$prefix}accordion-btn-active-icon: #{escape-svg($accordion-button-active-icon-dark)};
}
}
}
}

View File

@ -7,7 +7,8 @@
// Base styles
//
.alert {
@layer components {
.alert {
// scss-docs-start alert-css-vars
--#{$prefix}alert-bg: transparent;
--#{$prefix}alert-padding-x: #{$alert-padding-x};
@ -27,26 +28,26 @@
background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border);
@include border-radius(var(--#{$prefix}alert-border-radius));
}
}
// Headings for larger alerts
.alert-heading {
// Headings for larger alerts
.alert-heading {
// Specified to prevent conflicts of changing $headings-color
color: inherit;
}
}
// Provide class for links that match alerts
.alert-link {
// Provide class for links that match alerts
.alert-link {
font-weight: $alert-link-font-weight;
color: var(--#{$prefix}alert-link-color);
}
}
// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
.alert-dismissible {
.alert-dismissible {
padding-right: $alert-dismissible-padding-r;
// Adjust close link position
@ -57,17 +58,18 @@
z-index: $stretched-link-z-index + 1;
padding: $alert-padding-y * 1.25 $alert-padding-x;
}
}
}
// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert
@each $state in map.keys($theme-colors) {
// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert
@each $state in map.keys($theme-colors) {
.alert-#{$state} {
--#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}alert-link-color: var(--#{$prefix}#{$state}-text-emphasis);
}
}
// scss-docs-end alert-modifiers
}
// scss-docs-end alert-modifiers

View File

@ -9,7 +9,8 @@
// Requires one of the contextual, color modifier classes for `color` and
// `background-color`.
.badge {
@layer components {
.badge {
// scss-docs-start badge-css-vars
--#{$prefix}badge-padding-x: #{$badge-padding-x};
--#{$prefix}badge-padding-y: #{$badge-padding-y};
@ -35,10 +36,11 @@
&:empty {
display: none;
}
}
}
// Quick fix for badges in buttons
.btn .badge {
// Quick fix for badges in buttons
.btn .badge {
position: relative;
top: -1px;
}
}

View File

@ -3,7 +3,8 @@
@use "mixins/border-radius" as *;
@use "vendor/rfs" as *;
.breadcrumb {
@layer components {
.breadcrumb {
// scss-docs-start breadcrumb-css-vars
--#{$prefix}breadcrumb-padding-x: #{$breadcrumb-padding-x};
--#{$prefix}breadcrumb-padding-y: #{$breadcrumb-padding-y};
@ -24,9 +25,9 @@
list-style: none;
background-color: var(--#{$prefix}breadcrumb-bg);
@include border-radius(var(--#{$prefix}breadcrumb-border-radius));
}
}
.breadcrumb-item {
.breadcrumb-item {
// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .breadcrumb-item {
padding-left: var(--#{$prefix}breadcrumb-item-padding-x);
@ -42,4 +43,5 @@
&.active {
color: var(--#{$prefix}breadcrumb-item-active-color);
}
}
}

View File

@ -3,9 +3,10 @@
@use "mixins/border-radius" as *;
@use "mixins/box-shadow" as *;
// Make the div behave like a button
.btn-group,
.btn-group-vertical {
@layer components {
// Make the div behave like a button
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-flex;
vertical-align: middle; // match .btn alignment given font-size hack above
@ -25,10 +26,10 @@
> .btn.active {
z-index: 1;
}
}
}
// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
// Optional: Group multiple button groups together for a toolbar
.btn-toolbar {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
@ -36,9 +37,9 @@
.input-group {
width: auto;
}
}
}
.btn-group {
.btn-group {
@include border-radius($btn-border-radius);
// Prevent double borders when buttons are next to each other
@ -63,21 +64,21 @@
> .btn-group:not(:first-child) > .btn {
@include border-start-radius(0);
}
}
}
// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation.
// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation.
.btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }
.btn-group-sm > .btn { @extend .btn-sm; }
.btn-group-lg > .btn { @extend .btn-lg; }
//
// Split button dropdowns
//
//
// Split button dropdowns
//
.dropdown-toggle-split {
.dropdown-toggle-split {
padding-right: $btn-padding-x * .75;
padding-left: $btn-padding-x * .75;
@ -90,36 +91,36 @@
.dropstart &::before {
margin-right: 0;
}
}
}
.btn-sm + .dropdown-toggle-split {
.btn-sm + .dropdown-toggle-split {
padding-right: $btn-padding-x-sm * .75;
padding-left: $btn-padding-x-sm * .75;
}
}
.btn-lg + .dropdown-toggle-split {
.btn-lg + .dropdown-toggle-split {
padding-right: $btn-padding-x-lg * .75;
padding-left: $btn-padding-x-lg * .75;
}
}
// The clickable button for toggling the menu
// Set the same inset shadow as the :active state
.btn-group.show .dropdown-toggle {
// The clickable button for toggling the menu
// Set the same inset shadow as the :active state
.btn-group.show .dropdown-toggle {
@include box-shadow($btn-active-box-shadow);
// Show no shadow for `.btn-link` since it has no other button styles.
&.btn-link {
@include box-shadow(none);
}
}
}
//
// Vertical button groups
//
//
// Vertical button groups
//
.btn-group-vertical {
.btn-group-vertical {
flex-direction: column;
align-items: flex-start;
justify-content: center;
@ -149,4 +150,5 @@
> .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
}
}
}

View File

@ -85,7 +85,8 @@
// Base styles
//
.btn {
@layer components {
.btn {
// scss-docs-start btn-css-vars
--#{$prefix}btn-padding-x: #{$btn-padding-x};
--#{$prefix}btn-padding-y: #{$btn-padding-y};
@ -203,15 +204,15 @@
opacity: var(--#{$prefix}btn-disabled-opacity);
@include box-shadow(none);
}
}
}
//
// Alternate buttons
//
//
// Alternate buttons
//
// scss-docs-start btn-variant-loops
@each $color, $value in $theme-colors {
// scss-docs-start btn-variant-loops
@each $color, $value in $theme-colors {
.btn-#{$color} {
@if $color == "light" {
@include button-variant(
@ -235,22 +236,22 @@
@include button-variant($value, $value);
}
}
}
}
@each $color, $value in $theme-colors {
@each $color, $value in $theme-colors {
.btn-outline-#{$color} {
@include button-outline-variant($value);
}
}
// scss-docs-end btn-variant-loops
}
// scss-docs-end btn-variant-loops
//
// Link buttons
//
//
// Link buttons
//
// Make a button look and behave like a link
.btn-link {
// Make a button look and behave like a link
.btn-link {
--#{$prefix}btn-font-weight: #{$font-weight-normal};
--#{$prefix}btn-color: #{$btn-link-color};
--#{$prefix}btn-bg: transparent;
@ -283,17 +284,18 @@
}
// No need for an active state here
}
}
//
// Button Sizes
//
//
// Button Sizes
//
.btn-lg {
.btn-lg {
@include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
}
}
.btn-sm {
.btn-sm {
@include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
}
}

View File

@ -8,7 +8,8 @@
// Base styles
//
.card {
@layer components {
.card {
// scss-docs-start card-css-vars
--#{$prefix}card-spacer-y: #{$card-spacer-y};
--#{$prefix}card-spacer-x: #{$card-spacer-x};
@ -70,32 +71,32 @@
> .list-group + .card-footer {
border-top: 0;
}
}
}
.card-body {
.card-body {
// Enable `flex-grow: 1` for decks and groups so that card blocks take up
// as much space as possible, ensuring footers are aligned to the bottom.
flex: 1 1 auto;
padding: var(--#{$prefix}card-spacer-y) var(--#{$prefix}card-spacer-x);
color: var(--#{$prefix}card-color);
}
}
.card-title {
.card-title {
margin-bottom: var(--#{$prefix}card-title-spacer-y);
color: var(--#{$prefix}card-title-color);
}
}
.card-subtitle {
.card-subtitle {
margin-top: calc(-.5 * var(--#{$prefix}card-title-spacer-y));
margin-bottom: 0;
color: var(--#{$prefix}card-subtitle-color);
}
}
.card-text:last-child {
.card-text:last-child {
margin-bottom: 0;
}
}
.card-link {
.card-link {
&:hover {
text-decoration: if($link-hover-decoration == underline, none, null);
}
@ -103,13 +104,13 @@
+ .card-link {
margin-left: var(--#{$prefix}card-spacer-x);
}
}
}
//
// Optional textual caps
//
//
// Optional textual caps
//
.card-header {
.card-header {
padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x);
margin-bottom: 0; // Removes the default margin-bottom of <hN>
color: var(--#{$prefix}card-cap-color);
@ -119,9 +120,9 @@
&:first-child {
@include border-radius(var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius) 0 0);
}
}
}
.card-footer {
.card-footer {
padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x);
color: var(--#{$prefix}card-cap-color);
background-color: var(--#{$prefix}card-cap-bg);
@ -130,14 +131,14 @@
&:last-child {
@include border-radius(0 0 var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius));
}
}
}
//
// Header navs
//
//
// Header navs
//
.card-header-tabs {
.card-header-tabs {
margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x));
margin-bottom: calc(-1 * var(--#{$prefix}card-cap-padding-y));
margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x));
@ -147,15 +148,15 @@
background-color: var(--#{$prefix}card-bg);
border-bottom-color: var(--#{$prefix}card-bg);
}
}
}
.card-header-pills {
.card-header-pills {
margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x));
margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x));
}
}
// Card image
.card-img-overlay {
// Card image
.card-img-overlay {
position: absolute;
top: 0;
right: 0;
@ -163,30 +164,30 @@
left: 0;
padding: var(--#{$prefix}card-img-overlay-padding);
@include border-radius(var(--#{$prefix}card-inner-border-radius));
}
}
.card-img,
.card-img-top,
.card-img-bottom {
.card-img,
.card-img-top,
.card-img-bottom {
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
}
}
.card-img,
.card-img-top {
.card-img,
.card-img-top {
@include border-top-radius(var(--#{$prefix}card-inner-border-radius));
}
}
.card-img,
.card-img-bottom {
.card-img,
.card-img-bottom {
@include border-bottom-radius(var(--#{$prefix}card-inner-border-radius));
}
}
//
// Card groups
//
//
// Card groups
//
.card-group {
.card-group {
// The child selector allows nested `.card` within `.card-group`
// to display properly.
> .card {
@ -241,4 +242,5 @@
}
}
}
}
}

View File

@ -18,22 +18,23 @@
// 5. .carousel-item-next.carousel-item-start and .carousel-item-prev.carousel-item-end
// is the upcoming slide in transition.
.carousel {
@layer components {
.carousel {
position: relative;
}
}
.carousel.pointer-event {
.carousel.pointer-event {
touch-action: pan-y;
}
}
.carousel-inner {
.carousel-inner {
position: relative;
display: flow-root;
width: 100%;
overflow: hidden;
}
}
.carousel-item {
.carousel-item {
position: relative;
display: none;
float: left;
@ -41,30 +42,30 @@
margin-right: -100%;
backface-visibility: hidden;
@include transition($carousel-transition);
}
}
.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
display: block;
}
}
.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
transform: translateX(100%);
}
}
.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
transform: translateX(-100%);
}
}
//
// Alternate transitions
//
//
// Alternate transitions
//
.carousel-fade {
.carousel-fade {
.carousel-item {
opacity: 0;
transition-property: opacity;
@ -84,15 +85,15 @@
opacity: 0;
@include transition(opacity 0s $carousel-transition-duration);
}
}
}
//
// Left/right controls for nav
//
//
// Left/right controls for nav
//
.carousel-control-prev,
.carousel-control-next {
.carousel-control-prev,
.carousel-control-next {
position: absolute;
top: 0;
bottom: 0;
@ -119,40 +120,40 @@
outline: 0;
opacity: $carousel-control-hover-opacity;
}
}
.carousel-control-prev {
}
.carousel-control-prev {
left: 0;
background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null);
}
.carousel-control-next {
}
.carousel-control-next {
right: 0;
background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null);
}
}
// Icons for within
.carousel-control-prev-icon,
.carousel-control-next-icon {
// Icons for within
.carousel-control-prev-icon,
.carousel-control-next-icon {
display: inline-block;
width: $carousel-control-icon-width;
height: $carousel-control-icon-width;
background-repeat: no-repeat;
background-position: 50%;
background-size: 100% 100%;
}
}
.carousel-control-prev-icon {
.carousel-control-prev-icon {
background-image: escape-svg($carousel-control-prev-icon-bg) #{"/*rtl:" + escape-svg($carousel-control-next-icon-bg) + "*/"};
}
.carousel-control-next-icon {
}
.carousel-control-next-icon {
background-image: escape-svg($carousel-control-next-icon-bg) #{"/*rtl:" + escape-svg($carousel-control-prev-icon-bg) + "*/"};
}
}
// Optional indicator pips/controls
//
// Add a container (such as a list) with the following class and add an item (ideally a focusable control,
// like a button) with data-bs-target for each slide your carousel holds.
// Optional indicator pips/controls
//
// Add a container (such as a list) with the following class and add an item (ideally a focusable control,
// like a button) with data-bs-target for each slide your carousel holds.
.carousel-indicators {
.carousel-indicators {
position: absolute;
right: 0;
bottom: 0;
@ -189,14 +190,14 @@
.active {
opacity: $carousel-indicator-active-opacity;
}
}
}
// Optional captions
//
//
// Optional captions
//
//
.carousel-caption {
.carousel-caption {
position: absolute;
right: (100% - $carousel-caption-width) * .5;
bottom: $carousel-caption-spacer;
@ -205,29 +206,30 @@
padding-bottom: $carousel-caption-padding-y;
color: var(--#{$prefix}carousel-caption-color);
text-align: center;
}
}
// Dark mode carousel
// Dark mode carousel
@mixin carousel-dark() {
@mixin carousel-dark() {
--#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg-dark};
--#{$prefix}carousel-caption-color: #{$carousel-caption-color-dark};
--#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter-dark};
}
}
.carousel-dark {
.carousel-dark {
@include carousel-dark();
}
}
:root,
[data-bs-theme="light"] {
:root,
[data-bs-theme="light"] {
--#{$prefix}carousel-indicator-active-bg: #{$carousel-indicator-active-bg};
--#{$prefix}carousel-caption-color: #{$carousel-caption-color};
--#{$prefix}carousel-control-icon-filter: #{$carousel-control-icon-filter};
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark, true) {
@include carousel-dark();
}
}
}

View File

@ -8,7 +8,8 @@
// If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
.btn-close {
@layer components {
.btn-close {
// scss-docs-start close-css-vars
--#{$prefix}btn-close-color: #{$btn-close-color};
--#{$prefix}btn-close-bg: #{ escape-svg($btn-close-bg) };
@ -49,23 +50,24 @@
user-select: none;
opacity: var(--#{$prefix}btn-close-disabled-opacity);
}
}
}
@mixin btn-close-white() {
@mixin btn-close-white() {
--#{$prefix}btn-close-filter: #{$btn-close-filter-dark};
}
}
.btn-close-white {
.btn-close-white {
@include btn-close-white();
}
}
:root,
[data-bs-theme="light"] {
:root,
[data-bs-theme="light"] {
--#{$prefix}btn-close-filter: #{$btn-close-filter};
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark, true) {
@include btn-close-white();
}
}
}

View File

@ -9,25 +9,26 @@
@use "vendor/rfs" as *;
@use "layout/breakpoints" as *;
// The dropdown wrapper (`<div>`)
.dropup,
.dropend,
.dropdown,
.dropstart,
.dropup-center,
.dropdown-center {
@layer components {
// The dropdown wrapper (`<div>`)
.dropup,
.dropend,
.dropdown,
.dropstart,
.dropup-center,
.dropdown-center {
position: relative;
}
}
.dropdown-toggle {
.dropdown-toggle {
white-space: nowrap;
// Generate the caret automatically
@include caret();
}
}
// The dropdown menu
.dropdown-menu {
// The dropdown menu
.dropdown-menu {
// scss-docs-start dropdown-css-vars
--#{$prefix}dropdown-zindex: #{$zindex-dropdown};
--#{$prefix}dropdown-min-width: #{$dropdown-min-width};
@ -90,13 +91,13 @@
}
}
}
}
// scss-docs-start responsive-breakpoints
// We deliberately hardcode the `bs-` prefix because we check
// this custom property in JS to determine Popper's positioning
// scss-docs-start responsive-breakpoints
// We deliberately hardcode the `bs-` prefix because we check
// this custom property in JS to determine Popper's positioning
@each $breakpoint in map.keys($grid-breakpoints) {
@each $breakpoint in map.keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@ -118,12 +119,12 @@
}
}
}
}
// scss-docs-end responsive-breakpoints
}
// scss-docs-end responsive-breakpoints
// Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set.
.dropup {
// Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set.
.dropup {
.dropdown-menu[data-bs-popper] {
top: auto;
bottom: 100%;
@ -134,9 +135,9 @@
.dropdown-toggle {
@include caret(up);
}
}
}
.dropend {
.dropend {
.dropdown-menu[data-bs-popper] {
top: 0;
right: auto;
@ -151,9 +152,9 @@
vertical-align: 0;
}
}
}
}
.dropstart {
.dropstart {
.dropdown-menu[data-bs-popper] {
top: 0;
right: 100%;
@ -168,22 +169,22 @@
vertical-align: 0;
}
}
}
}
// Dividers (basically an `<hr>`) within the dropdown
.dropdown-divider {
// Dividers (basically an `<hr>`) within the dropdown
.dropdown-divider {
height: 0;
margin: var(--#{$prefix}dropdown-divider-margin-y) 0;
overflow: hidden;
border-top: 1px solid var(--#{$prefix}dropdown-divider-bg);
opacity: 1; // Revisit in v6 to de-dupe styles that conflict with <hr> element
}
}
// Links, buttons, and more within the dropdown menu
//
// `<button>`-specific styles are denoted with `// For <button>s`
.dropdown-item {
// Links, buttons, and more within the dropdown menu
//
// `<button>`-specific styles are denoted with `// For <button>s`
.dropdown-item {
display: block;
width: 100%; // For `<button>`s
padding: var(--#{$prefix}dropdown-item-padding-y) var(--#{$prefix}dropdown-item-padding-x);
@ -219,31 +220,31 @@
// Remove CSS gradients if they're enabled
background-image: if($enable-gradients, none, null);
}
}
}
.dropdown-menu.show {
.dropdown-menu.show {
display: block;
}
}
// Dropdown section headers
.dropdown-header {
// Dropdown section headers
.dropdown-header {
display: block;
padding: var(--#{$prefix}dropdown-header-padding-y) var(--#{$prefix}dropdown-header-padding-x);
margin-bottom: 0; // for use with heading elements
@include font-size($font-size-sm);
color: var(--#{$prefix}dropdown-header-color);
white-space: nowrap; // as with > li > a
}
}
// Dropdown text
.dropdown-item-text {
// Dropdown text
.dropdown-item-text {
display: block;
padding: var(--#{$prefix}dropdown-item-padding-y) var(--#{$prefix}dropdown-item-padding-x);
color: var(--#{$prefix}dropdown-link-color);
}
}
// Dark dropdowns
.dropdown-menu-dark {
// Dark dropdowns
.dropdown-menu-dark {
// scss-docs-start dropdown-dark-css-vars
--#{$prefix}dropdown-color: #{$dropdown-dark-color};
--#{$prefix}dropdown-bg: #{$dropdown-dark-bg};
@ -258,4 +259,5 @@
--#{$prefix}dropdown-link-disabled-color: #{$dropdown-dark-link-disabled-color};
--#{$prefix}dropdown-header-color: #{$dropdown-dark-header-color};
// scss-docs-end dropdown-dark-css-vars
}
}

View File

@ -10,7 +10,8 @@
//
// Easily usable on <ul>, <ol>, or <div>.
.list-group {
@layer components {
.list-group {
// scss-docs-start list-group-css-vars
--#{$prefix}list-group-color: #{$list-group-color};
--#{$prefix}list-group-bg: #{$list-group-bg};
@ -38,9 +39,9 @@
padding-left: 0; // reset padding because ul and ol
margin-bottom: 0;
@include border-radius(var(--#{$prefix}list-group-border-radius));
}
}
.list-group-numbered {
.list-group-numbered {
list-style-type: none;
counter-reset: section;
@ -49,13 +50,13 @@
content: counters(section, ".") ". ";
counter-increment: section;
}
}
}
// Individual list items
//
// Use on `li`s or `div`s within the `.list-group` parent.
// Individual list items
//
// Use on `li`s or `div`s within the `.list-group` parent.
.list-group-item {
.list-group-item {
position: relative;
display: block;
padding: var(--#{$prefix}list-group-item-padding-y) var(--#{$prefix}list-group-item-padding-x);
@ -96,14 +97,14 @@
border-top-width: var(--#{$prefix}list-group-border-width);
}
}
}
}
// Interactive list items
//
// Use anchor or button elements instead of `li`s or `div`s to create interactive
// list items. Includes an extra `.active` modifier class for selected items.
// Interactive list items
//
// Use anchor or button elements instead of `li`s or `div`s to create interactive
// list items. Includes an extra `.active` modifier class for selected items.
.list-group-item-action {
.list-group-item-action {
width: 100%; // For `<button>`s (anchors become 100% by default though)
color: var(--#{$prefix}list-group-action-color);
text-align: inherit; // For `<button>`s (anchors inherit)
@ -123,13 +124,13 @@
background-color: var(--#{$prefix}list-group-action-active-bg);
}
}
}
}
// Horizontal
//
// Change the layout of list group items from vertical (default) to horizontal.
// Horizontal
//
// Change the layout of list group items from vertical (default) to horizontal.
@each $breakpoint in map.keys($grid-breakpoints) {
@each $breakpoint in map.keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@ -163,15 +164,15 @@
}
}
}
}
}
// Flush list items
//
// Remove borders and border-radius to keep list group items edge-to-edge. Most
// useful within other components (e.g., cards).
// Flush list items
//
// Remove borders and border-radius to keep list group items edge-to-edge. Most
// useful within other components (e.g., cards).
.list-group-flush {
.list-group-flush {
@include border-radius(0);
> .list-group-item {
@ -181,16 +182,16 @@
border-bottom-width: 0;
}
}
}
}
// scss-docs-start list-group-modifiers
// List group contextual variants
//
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states.
// scss-docs-start list-group-modifiers
// List group contextual variants
//
// Add modifier classes to change text and background color on individual items.
// Organizationally, this must come after the `:hover` states.
@each $state in map.keys($theme-colors) {
@each $state in map.keys($theme-colors) {
.list-group-item-#{$state} {
--#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
@ -203,5 +204,6 @@
--#{$prefix}list-group-active-bg: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}list-group-active-border-color: var(--#{$prefix}#{$state}-text-emphasis);
}
}
// scss-docs-end list-group-modifiers
}
// scss-docs-end list-group-modifiers

View File

@ -14,9 +14,9 @@
// .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff
// Container that the modal scrolls within
.modal {
@layer components {
// Container that the modal scrolls within
.modal {
// scss-docs-start modal-css-vars
--#{$prefix}modal-zindex: #{$zindex-modal};
--#{$prefix}modal-width: #{$modal-md};
@ -56,10 +56,10 @@
// We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a
// gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
// See also https://github.com/twbs/bootstrap/issues/17695
}
}
// Shell div to position the modal with bottom padding
.modal-dialog {
// Shell div to position the modal with bottom padding
.modal-dialog {
position: relative;
width: auto;
margin: var(--#{$prefix}modal-margin);
@ -79,9 +79,9 @@
.modal.modal-static & {
transform: $modal-scale-transform;
}
}
}
.modal-dialog-scrollable {
.modal-dialog-scrollable {
height: calc(100% - var(--#{$prefix}modal-margin) * 2);
.modal-content {
@ -92,16 +92,16 @@
.modal-body {
overflow-y: auto;
}
}
}
.modal-dialog-centered {
.modal-dialog-centered {
display: flex;
align-items: center;
min-height: calc(100% - var(--#{$prefix}modal-margin) * 2);
}
}
// Actual modal
.modal-content {
// Actual modal
.modal-content {
position: relative;
display: flex;
flex-direction: column;
@ -116,10 +116,10 @@
@include box-shadow(var(--#{$prefix}modal-box-shadow));
// Remove focus outline from opened modal
outline: 0;
}
}
// Modal background
.modal-backdrop {
// Modal background
.modal-backdrop {
// scss-docs-start modal-backdrop-css-vars
--#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
--#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
@ -127,11 +127,11 @@
// scss-docs-end modal-backdrop-css-vars
@include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity));
}
}
// Modal header
// Top section of the modal w/ title and dismiss
.modal-header {
// Modal header
// Top section of the modal w/ title and dismiss
.modal-header {
display: flex;
flex-shrink: 0;
align-items: center;
@ -147,26 +147,26 @@
margin-bottom: calc(-.5 * var(--#{$prefix}modal-header-padding-y));
margin-left: auto;
}
}
}
// Title text within header
.modal-title {
// Title text within header
.modal-title {
margin-bottom: 0;
line-height: var(--#{$prefix}modal-title-line-height);
}
}
// Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-body {
// Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-body {
position: relative;
// Enable `flex-grow: 1` so that the body take up as much space as possible
// when there should be a fixed height on `.modal-dialog`.
flex: 1 1 auto;
padding: var(--#{$prefix}modal-padding);
}
}
// Footer (for actions)
.modal-footer {
// Footer (for actions)
.modal-footer {
display: flex;
flex-shrink: 0;
flex-wrap: wrap;
@ -183,10 +183,10 @@
> * {
margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class
}
}
}
// Scale up the modal
@include media-breakpoint-up(sm) {
// Scale up the modal
@include media-breakpoint-up(sm) {
.modal {
--#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up};
--#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up};
@ -202,23 +202,23 @@
.modal-sm {
--#{$prefix}modal-width: #{$modal-sm};
}
}
}
@include media-breakpoint-up(lg) {
@include media-breakpoint-up(lg) {
.modal-lg,
.modal-xl {
--#{$prefix}modal-width: #{$modal-lg};
}
}
}
@include media-breakpoint-up(xl) {
@include media-breakpoint-up(xl) {
.modal-xl {
--#{$prefix}modal-width: #{$modal-xl};
}
}
}
// scss-docs-start modal-fullscreen-loop
@each $breakpoint in map.keys($grid-breakpoints) {
// scss-docs-start modal-fullscreen-loop
@each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
$postfix: if($infix != "", $infix + "-down", "");
@ -245,5 +245,6 @@
}
}
}
}
// scss-docs-end modal-fullscreen-loop
}
// scss-docs-end modal-fullscreen-loop

View File

@ -10,7 +10,8 @@
// Kickstart any navigation component with a set of style resets. Works with
// `<nav>`s, `<ul>`s or `<ol>`s.
.nav {
@layer components {
.nav {
// scss-docs-start nav-css-vars
--#{$prefix}nav-link-padding-x: #{$nav-link-padding-x};
--#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
@ -26,9 +27,9 @@
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
}
.nav-link {
.nav-link {
display: block;
padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x);
@include font-size(var(--#{$prefix}nav-link-font-size));
@ -57,13 +58,13 @@
pointer-events: none;
cursor: default;
}
}
}
//
// Tabs
//
//
// Tabs
//
.nav-tabs {
.nav-tabs {
// scss-docs-start nav-tabs-css-vars
--#{$prefix}nav-tabs-border-width: #{$nav-tabs-border-width};
--#{$prefix}nav-tabs-border-color: #{$nav-tabs-border-color};
@ -102,14 +103,14 @@
// Remove the top rounded corners here since there is a hard edge above the menu
@include border-top-radius(0);
}
}
}
//
// Pills
//
//
// Pills
//
.nav-pills {
.nav-pills {
// scss-docs-start nav-pills-css-vars
--#{$prefix}nav-pills-border-radius: #{$nav-pills-border-radius};
--#{$prefix}nav-pills-link-active-color: #{$nav-pills-link-active-color};
@ -125,14 +126,14 @@
color: var(--#{$prefix}nav-pills-link-active-color);
@include gradient-bg(var(--#{$prefix}nav-pills-link-active-bg));
}
}
}
//
// Underline
//
//
// Underline
//
.nav-underline {
.nav-underline {
// scss-docs-start nav-underline-css-vars
--#{$prefix}nav-underline-gap: #{$nav-underline-gap};
--#{$prefix}nav-underline-border-width: #{$nav-underline-border-width};
@ -158,47 +159,48 @@
color: var(--#{$prefix}nav-underline-link-active-color);
border-bottom-color: currentcolor;
}
}
}
//
// Justified variants
//
//
// Justified variants
//
.nav-fill {
.nav-fill {
> .nav-link,
.nav-item {
flex: 1 1 auto;
text-align: center;
}
}
}
.nav-justified {
.nav-justified {
> .nav-link,
.nav-item {
flex-grow: 1;
flex-basis: 0;
text-align: center;
}
}
}
.nav-fill,
.nav-justified {
.nav-fill,
.nav-justified {
.nav-item .nav-link {
width: 100%; // Make sure button will grow
}
}
}
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active`
// Tabbable tabs
//
// Hide tabbable panes to start, show them when `.active`
.tab-content {
.tab-content {
> .tab-pane {
display: none;
}
> .active {
display: block;
}
}
}

View File

@ -15,7 +15,8 @@
// Provide a static navbar from which we expand to create full-width, fixed, and
// other navbar variations.
.navbar {
@layer components {
.navbar {
// scss-docs-start navbar-css-vars
--#{$prefix}navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
--#{$prefix}navbar-padding-y: #{$navbar-padding-y};
@ -67,14 +68,14 @@
@extend %container-flex-properties;
}
}
}
}
// Navbar brand
//
// Used for brand, project, or site names.
// Navbar brand
//
// Used for brand, project, or site names.
.navbar-brand {
.navbar-brand {
padding-top: var(--#{$prefix}navbar-brand-padding-y);
padding-bottom: var(--#{$prefix}navbar-brand-padding-y);
margin-right: var(--#{$prefix}navbar-brand-margin-end);
@ -88,14 +89,14 @@
color: var(--#{$prefix}navbar-brand-hover-color);
text-decoration: if($link-hover-decoration == underline, none, null);
}
}
}
// Navbar nav
//
// Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
// Navbar nav
//
// Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
.navbar-nav {
.navbar-nav {
// scss-docs-start navbar-nav-css-vars
--#{$prefix}nav-link-padding-x: 0;
--#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
@ -122,14 +123,14 @@
.dropdown-menu {
position: static;
}
}
}
// Navbar text
//
//
// Navbar text
//
//
.navbar-text {
.navbar-text {
padding-top: $nav-link-padding-y;
padding-bottom: $nav-link-padding-y;
color: var(--#{$prefix}navbar-color);
@ -139,27 +140,27 @@
a:focus {
color: var(--#{$prefix}navbar-active-color);
}
}
}
// Responsive navbar
//
// Custom styles for responsive collapsing and toggling of navbar contents.
// Powered by the collapse Bootstrap JavaScript plugin.
// Responsive navbar
//
// Custom styles for responsive collapsing and toggling of navbar contents.
// Powered by the collapse Bootstrap JavaScript plugin.
// When collapsed, prevent the toggleable navbar contents from appearing in
// the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
// on the `.navbar` parent.
.navbar-collapse {
// When collapsed, prevent the toggleable navbar contents from appearing in
// the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
// on the `.navbar` parent.
.navbar-collapse {
flex-grow: 1;
flex-basis: 100%;
// For always expanded or extra full navbars, ensure content aligns itself
// properly vertically. Can be easily overridden with flex utilities.
align-items: center;
}
}
// Button for toggling the navbar when in its collapsed state
.navbar-toggler {
// Button for toggling the navbar when in its collapsed state
.navbar-toggler {
padding: var(--#{$prefix}navbar-toggler-padding-y) var(--#{$prefix}navbar-toggler-padding-x);
@include font-size(var(--#{$prefix}navbar-toggler-font-size));
line-height: 1;
@ -178,11 +179,11 @@
outline: 0;
box-shadow: 0 0 0 var(--#{$prefix}navbar-toggler-focus-width);
}
}
}
// Keep as a separate element so folks can easily override it with another icon
// or image file as needed.
.navbar-toggler-icon {
// Keep as a separate element so folks can easily override it with another icon
// or image file as needed.
.navbar-toggler-icon {
display: inline-block;
width: 1.5em;
height: 1.5em;
@ -191,17 +192,17 @@
background-repeat: no-repeat;
background-position: center;
background-size: 100%;
}
}
.navbar-nav-scroll {
.navbar-nav-scroll {
max-height: var(--#{$prefix}scroll-height, 75vh);
overflow-y: auto;
}
}
// scss-docs-start navbar-expand-loop
// Generate series of `.navbar-expand-*` responsive classes for configuring
// where your navbar collapses.
.navbar-expand {
// scss-docs-start navbar-expand-loop
// Generate series of `.navbar-expand-*` responsive classes for configuring
// where your navbar collapses.
.navbar-expand {
@each $breakpoint in map.keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);
@ -267,19 +268,19 @@
}
}
}
}
// scss-docs-end navbar-expand-loop
}
// scss-docs-end navbar-expand-loop
// Navbar themes
//
// Styles for switching between navbars with light or dark background.
// Navbar themes
//
// Styles for switching between navbars with light or dark background.
.navbar-light {
.navbar-light {
@include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true);
}
}
.navbar-dark,
.navbar[data-bs-theme="dark"] {
.navbar-dark,
.navbar[data-bs-theme="dark"] {
// scss-docs-start navbar-dark-css-vars
--#{$prefix}navbar-color: #{$navbar-dark-color};
--#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
@ -290,12 +291,13 @@
--#{$prefix}navbar-toggler-border-color: #{$navbar-dark-toggler-border-color};
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
// scss-docs-end navbar-dark-css-vars
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark) {
.navbar-toggler-icon {
--#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
}
}
}
}

View File

@ -23,16 +23,17 @@
// scss-docs-end offcanvas-css-vars
}
@each $breakpoint in map.keys($grid-breakpoints) {
@layer components {
@each $breakpoint in map.keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);
.offcanvas#{$infix} {
@extend %offcanvas-css-vars;
}
}
}
@each $breakpoint in map.keys($grid-breakpoints) {
@each $breakpoint in map.keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);
@ -120,13 +121,13 @@
}
}
}
}
}
.offcanvas-backdrop {
.offcanvas-backdrop {
@include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
}
}
.offcanvas-header {
.offcanvas-header {
display: flex;
align-items: center;
padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
@ -139,15 +140,16 @@
margin-bottom: calc(-.5 * var(--#{$prefix}offcanvas-padding-y));
margin-left: auto;
}
}
}
.offcanvas-title {
.offcanvas-title {
margin-bottom: 0;
line-height: var(--#{$prefix}offcanvas-title-line-height);
}
}
.offcanvas-body {
.offcanvas-body {
flex-grow: 1;
padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
overflow-y: auto;
}
}

View File

@ -15,7 +15,8 @@
}
// scss-docs-end pagination-mixin
.pagination {
@layer components {
.pagination {
// scss-docs-start pagination-css-vars
--#{$prefix}pagination-padding-x: #{$pagination-padding-x};
--#{$prefix}pagination-padding-y: #{$pagination-padding-y};
@ -41,9 +42,9 @@
display: flex;
@include list-unstyled();
}
}
.page-link {
.page-link {
position: relative;
display: block;
padding: var(--#{$prefix}pagination-padding-y) var(--#{$prefix}pagination-padding-x);
@ -85,9 +86,9 @@
background-color: var(--#{$prefix}pagination-disabled-bg);
border-color: var(--#{$prefix}pagination-disabled-border-color);
}
}
}
.page-item {
.page-item {
&:not(:first-child) .page-link {
margin-left: $pagination-margin-start;
}
@ -110,17 +111,18 @@
@include border-radius(var(--#{$prefix}pagination-border-radius));
}
}
}
}
//
// Sizing
//
//
// Sizing
//
.pagination-lg {
.pagination-lg {
@include pagination-size($pagination-padding-y-lg, $pagination-padding-x-lg, $font-size-lg, $pagination-border-radius-lg);
}
}
.pagination-sm {
.pagination-sm {
@include pagination-size($pagination-padding-y-sm, $pagination-padding-x-sm, $font-size-sm, $pagination-border-radius-sm);
}
}

View File

@ -2,7 +2,8 @@
@use "config" as *;
@use "variables" as *;
.placeholder {
@layer components {
.placeholder {
display: inline-block;
min-height: 1em;
vertical-align: middle;
@ -14,42 +15,43 @@
display: inline-block;
content: "";
}
}
}
// Sizing
.placeholder-xs {
// Sizing
.placeholder-xs {
min-height: .6em;
}
}
.placeholder-sm {
.placeholder-sm {
min-height: .8em;
}
}
.placeholder-lg {
.placeholder-lg {
min-height: 1.2em;
}
}
// Animation
.placeholder-glow {
// Animation
.placeholder-glow {
.placeholder {
animation: placeholder-glow 2s ease-in-out infinite;
}
}
}
@keyframes placeholder-glow {
@keyframes placeholder-glow {
50% {
opacity: $placeholder-opacity-min;
}
}
}
.placeholder-wave {
.placeholder-wave {
mask-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%);
mask-size: 200% 100%;
animation: placeholder-wave 2s linear infinite;
}
}
@keyframes placeholder-wave {
@keyframes placeholder-wave {
100% {
mask-position: -200% 0%;
}
}
}

View File

@ -5,7 +5,8 @@
@use "vendor/rfs" as *;
@use "mixins/reset-text" as *;
.popover {
@layer components {
.popover {
// scss-docs-start popover-css-vars
--#{$prefix}popover-zindex: #{$zindex-popover};
--#{$prefix}popover-max-width: #{$popover-max-width};
@ -59,9 +60,9 @@
border-width: 0;
}
}
}
}
.bs-popover-top {
.bs-popover-top {
> .popover-arrow {
bottom: calc(-1 * (var(--#{$prefix}popover-arrow-height)) - var(--#{$prefix}popover-border-width));
@ -80,10 +81,10 @@
border-top-color: var(--#{$prefix}popover-bg);
}
}
}
}
/* rtl:begin:ignore */
.bs-popover-end {
/* rtl:begin:ignore */
.bs-popover-end {
> .popover-arrow {
left: calc(-1 * (var(--#{$prefix}popover-arrow-height)) - var(--#{$prefix}popover-border-width));
width: var(--#{$prefix}popover-arrow-height);
@ -104,11 +105,11 @@
border-right-color: var(--#{$prefix}popover-bg);
}
}
}
}
/* rtl:end:ignore */
/* rtl:end:ignore */
.bs-popover-bottom {
.bs-popover-bottom {
> .popover-arrow {
top: calc(-1 * (var(--#{$prefix}popover-arrow-height)) - var(--#{$prefix}popover-border-width));
@ -139,10 +140,10 @@
content: "";
border-bottom: var(--#{$prefix}popover-border-width) solid var(--#{$prefix}popover-header-bg);
}
}
}
/* rtl:begin:ignore */
.bs-popover-start {
/* rtl:begin:ignore */
.bs-popover-start {
> .popover-arrow {
right: calc(-1 * (var(--#{$prefix}popover-arrow-height)) - var(--#{$prefix}popover-border-width));
width: var(--#{$prefix}popover-arrow-height);
@ -163,11 +164,11 @@
border-left-color: var(--#{$prefix}popover-bg);
}
}
}
}
/* rtl:end:ignore */
/* rtl:end:ignore */
.bs-popover-auto {
.bs-popover-auto {
&[data-popper-placement^="top"] {
@extend .bs-popover-top;
}
@ -180,10 +181,10 @@
&[data-popper-placement^="left"] {
@extend .bs-popover-start;
}
}
}
// Offset the popover to account for the popover arrow
.popover-header {
// Offset the popover to account for the popover arrow
.popover-header {
padding: var(--#{$prefix}popover-header-padding-y) var(--#{$prefix}popover-header-padding-x);
margin-bottom: 0; // Reset the default from Reboot
@include font-size(var(--#{$prefix}popover-header-font-size));
@ -195,9 +196,10 @@
&:empty {
display: none;
}
}
}
.popover-body {
.popover-body {
padding: var(--#{$prefix}popover-body-padding-y) var(--#{$prefix}popover-body-padding-x);
color: var(--#{$prefix}popover-body-color);
}
}

View File

@ -8,16 +8,17 @@
// Disable animation if transitions are disabled
// scss-docs-start progress-keyframes
@if $enable-transitions {
@layer components {
// scss-docs-start progress-keyframes
@if $enable-transitions {
@keyframes progress-bar-stripes {
0% { background-position-x: var(--#{$prefix}progress-height); }
}
}
// scss-docs-end progress-keyframes
}
// scss-docs-end progress-keyframes
.progress,
.progress-stacked {
.progress,
.progress-stacked {
// scss-docs-start progress-css-vars
--#{$prefix}progress-height: #{$progress-height};
@include rfs($progress-font-size, --#{$prefix}progress-font-size);
@ -36,9 +37,9 @@
background-color: var(--#{$prefix}progress-bg);
@include border-radius(var(--#{$prefix}progress-border-radius));
@include box-shadow(var(--#{$prefix}progress-box-shadow));
}
}
.progress-bar {
.progress-bar {
display: flex;
flex-direction: column;
justify-content: center;
@ -48,22 +49,22 @@
white-space: nowrap;
background-color: var(--#{$prefix}progress-bar-bg);
@include transition(var(--#{$prefix}progress-bar-transition));
}
}
.progress-bar-striped {
.progress-bar-striped {
@include gradient-striped();
background-size: var(--#{$prefix}progress-height) var(--#{$prefix}progress-height);
}
}
.progress-stacked > .progress {
.progress-stacked > .progress {
overflow: visible;
}
}
.progress-stacked > .progress > .progress-bar {
.progress-stacked > .progress > .progress-bar {
width: 100%;
}
}
@if $enable-transitions {
@if $enable-transitions {
.progress-bar-animated {
animation: $progress-bar-animation-timing progress-bar-stripes;
@ -73,4 +74,5 @@
}
}
}
}
}

View File

@ -7,6 +7,9 @@
@use "vendor/rfs" as *;
@use "mixins/color-mode" as *;
// mdo-do: do we need theme?
@layer colors, theme, config, root, reboot, layout, content, forms, components, helpers, custom, utilities;
:root {
color-scheme: light dark;

View File

@ -17,8 +17,9 @@ $spinner-border-width-sm: .2em !default;
// Rotating border
//
.spinner-grow,
.spinner-border {
@layer components {
.spinner-grow,
.spinner-border {
display: inline-block;
flex-shrink: 0;
width: var(--#{$prefix}spinner-width);
@ -27,15 +28,15 @@ $spinner-border-width-sm: .2em !default;
// stylelint-disable-next-line property-disallowed-list
border-radius: 50%;
animation: var(--#{$prefix}spinner-animation-speed) linear infinite var(--#{$prefix}spinner-animation-name);
}
}
// scss-docs-start spinner-border-keyframes
@keyframes spinner-border {
// scss-docs-start spinner-border-keyframes
@keyframes spinner-border {
to { transform: rotate(360deg) #{"/* rtl:ignore */"}; }
}
// scss-docs-end spinner-border-keyframes
}
// scss-docs-end spinner-border-keyframes
.spinner-border {
.spinner-border {
// scss-docs-start spinner-border-css-vars
--#{$prefix}spinner-width: #{$spinner-width};
--#{$prefix}spinner-height: #{$spinner-height};
@ -47,22 +48,22 @@ $spinner-border-width-sm: .2em !default;
border: var(--#{$prefix}spinner-border-width) solid currentcolor;
border-right-color: transparent;
}
}
.spinner-border-sm {
.spinner-border-sm {
// scss-docs-start spinner-border-sm-css-vars
--#{$prefix}spinner-width: #{$spinner-width-sm};
--#{$prefix}spinner-height: #{$spinner-height-sm};
--#{$prefix}spinner-border-width: #{$spinner-border-width-sm};
// scss-docs-end spinner-border-sm-css-vars
}
}
//
// Growing circle
//
//
// Growing circle
//
// scss-docs-start spinner-grow-keyframes
@keyframes spinner-grow {
// scss-docs-start spinner-grow-keyframes
@keyframes spinner-grow {
0% {
transform: scale(0);
}
@ -70,10 +71,10 @@ $spinner-border-width-sm: .2em !default;
opacity: 1;
transform: none;
}
}
// scss-docs-end spinner-grow-keyframes
}
// scss-docs-end spinner-grow-keyframes
.spinner-grow {
.spinner-grow {
// scss-docs-start spinner-grow-css-vars
--#{$prefix}spinner-width: #{$spinner-width};
--#{$prefix}spinner-height: #{$spinner-height};
@ -84,18 +85,19 @@ $spinner-border-width-sm: .2em !default;
background-color: currentcolor;
opacity: 0;
}
}
.spinner-grow-sm {
.spinner-grow-sm {
--#{$prefix}spinner-width: #{$spinner-width-sm};
--#{$prefix}spinner-height: #{$spinner-height-sm};
}
}
@if $enable-reduced-motion {
@if $enable-reduced-motion {
@media (prefers-reduced-motion: reduce) {
.spinner-border,
.spinner-grow {
--#{$prefix}spinner-animation-speed: #{$spinner-animation-speed * 2};
}
}
}
}

View File

@ -3,7 +3,8 @@
@use "mixins/border-radius" as *;
@use "vendor/rfs" as *;
.toast {
@layer components {
.toast {
// scss-docs-start toast-css-vars
--#{$prefix}toast-zindex: #{$zindex-toast};
--#{$prefix}toast-padding-x: #{$toast-padding-x};
@ -40,9 +41,9 @@
&:not(.show) {
display: none;
}
}
}
.toast-container {
.toast-container {
--#{$prefix}toast-zindex: #{$zindex-toast};
position: absolute;
@ -54,9 +55,9 @@
> :not(:last-child) {
margin-bottom: var(--#{$prefix}toast-spacing);
}
}
}
.toast-header {
.toast-header {
display: flex;
align-items: center;
padding: var(--#{$prefix}toast-padding-y) var(--#{$prefix}toast-padding-x);
@ -70,9 +71,10 @@
margin-right: calc(-.5 * var(--#{$prefix}toast-padding-x));
margin-left: var(--#{$prefix}toast-padding-x);
}
}
}
.toast-body {
.toast-body {
padding: var(--#{$prefix}toast-padding-x);
word-wrap: break-word;
}
}

View File

@ -5,8 +5,8 @@
@use "vendor/rfs" as *;
@use "mixins/reset-text" as *;
// Base class
.tooltip {
@layer components {
.tooltip {
// scss-docs-start tooltip-css-vars
--#{$prefix}tooltip-zindex: #{$zindex-tooltip};
--#{$prefix}tooltip-max-width: #{$tooltip-max-width};
@ -48,9 +48,9 @@
border-style: solid;
}
}
}
}
.bs-tooltip-top .tooltip-arrow {
.bs-tooltip-top .tooltip-arrow {
bottom: calc(-1 * var(--#{$prefix}tooltip-arrow-height));
&::before {
@ -58,10 +58,10 @@
border-width: var(--#{$prefix}tooltip-arrow-height) calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0;
border-top-color: var(--#{$prefix}tooltip-bg);
}
}
}
/* rtl:begin:ignore */
.bs-tooltip-end .tooltip-arrow {
/* rtl:begin:ignore */
.bs-tooltip-end .tooltip-arrow {
left: calc(-1 * var(--#{$prefix}tooltip-arrow-height));
width: var(--#{$prefix}tooltip-arrow-height);
height: var(--#{$prefix}tooltip-arrow-width);
@ -71,11 +71,11 @@
border-width: calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height) calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0;
border-right-color: var(--#{$prefix}tooltip-bg);
}
}
}
/* rtl:end:ignore */
/* rtl:end:ignore */
.bs-tooltip-bottom .tooltip-arrow {
.bs-tooltip-bottom .tooltip-arrow {
top: calc(-1 * var(--#{$prefix}tooltip-arrow-height));
&::before {
@ -83,10 +83,10 @@
border-width: 0 calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height);
border-bottom-color: var(--#{$prefix}tooltip-bg);
}
}
}
/* rtl:begin:ignore */
.bs-tooltip-start .tooltip-arrow {
/* rtl:begin:ignore */
.bs-tooltip-start .tooltip-arrow {
right: calc(-1 * var(--#{$prefix}tooltip-arrow-height));
width: var(--#{$prefix}tooltip-arrow-height);
height: var(--#{$prefix}tooltip-arrow-width);
@ -96,11 +96,11 @@
border-width: calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0 calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height);
border-left-color: var(--#{$prefix}tooltip-bg);
}
}
}
/* rtl:end:ignore */
/* rtl:end:ignore */
.bs-tooltip-auto {
.bs-tooltip-auto {
&[data-popper-placement^="top"] {
@extend .bs-tooltip-top;
}
@ -113,14 +113,15 @@
&[data-popper-placement^="left"] {
@extend .bs-tooltip-start;
}
}
}
// Wrapper for the tooltip content
.tooltip-inner {
// Wrapper for the tooltip content
.tooltip-inner {
max-width: var(--#{$prefix}tooltip-max-width);
padding: var(--#{$prefix}tooltip-padding-y) var(--#{$prefix}tooltip-padding-x);
color: var(--#{$prefix}tooltip-color);
text-align: center;
background-color: var(--#{$prefix}tooltip-bg);
@include border-radius(var(--#{$prefix}tooltip-border-radius));
}
}

View File

@ -5,20 +5,21 @@
@use "../mixins/border-radius" as *;
@use "../mixins/box-shadow" as *;
// Responsive images (ensure images don't scale beyond their parents)
//
// This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
// We previously tried the "images are responsive by default" approach in Bootstrap v2,
// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
// which weren't expecting the images within themselves to be involuntarily resized.
// See also https://github.com/twbs/bootstrap/issues/18178
.img-fluid {
@layer content {
// Responsive images (ensure images don't scale beyond their parents)
//
// This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
// We previously tried the "images are responsive by default" approach in Bootstrap v2,
// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
// which weren't expecting the images within themselves to be involuntarily resized.
// See also https://github.com/twbs/bootstrap/issues/18178
.img-fluid {
@include img-fluid();
}
}
// Image thumbnails
.img-thumbnail {
// Image thumbnails
.img-thumbnail {
padding: $thumbnail-padding;
background-color: $thumbnail-bg;
border: $thumbnail-border-width solid $thumbnail-border-color;
@ -27,23 +28,24 @@
// Keep them at most 100% wide
@include img-fluid();
}
}
//
// Figures
//
//
// Figures
//
.figure {
.figure {
// Ensures the caption's text aligns with the image.
display: inline-block;
}
}
.figure-img {
.figure-img {
margin-bottom: $spacer * .5;
line-height: 1;
}
}
.figure-caption {
.figure-caption {
@include font-size($figure-caption-font-size);
color: $figure-caption-color;
}
}

View File

@ -6,32 +6,32 @@
// stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
// Reboot
//
// Normalization of HTML elements, manually forked from Normalize.css to remove
// styles targeting irrelevant browsers while applying new styles.
//
// Normalize is licensed MIT. https://github.com/necolas/normalize.css
@layer reboot {
// Reboot
//
// Normalization of HTML elements, manually forked from Normalize.css to remove
// styles targeting irrelevant browsers while applying new styles.
//
// Normalize is licensed MIT. https://github.com/necolas/normalize.css
// Document
//
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
// Document
//
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
*,
*::before,
*::after {
*,
*::before,
*::after {
box-sizing: border-box;
}
}
// Root
//
// Ability to the value of the root font sizes, affecting the value of `rem`.
// null by default, thus nothing is generated.
// Root
//
// Ability to the value of the root font sizes, affecting the value of `rem`.
// null by default, thus nothing is generated.
:root {
:root {
@if $font-size-root != null {
@include font-size(var(--#{$prefix}root-font-size));
}
@ -41,18 +41,18 @@
scroll-behavior: smooth;
}
}
}
}
// Body
//
// 1. Remove the margin in all browsers.
// 2. As a best practice, apply a default `background-color`.
// 3. Prevent adjustments of font size after orientation changes in iOS.
// 4. Change the default tap highlight to be completely transparent in iOS.
// Body
//
// 1. Remove the margin in all browsers.
// 2. As a best practice, apply a default `background-color`.
// 3. Prevent adjustments of font size after orientation changes in iOS.
// 4. Change the default tap highlight to be completely transparent in iOS.
// scss-docs-start reboot-body-rules
body {
// scss-docs-start reboot-body-rules
body {
margin: 0; // 1
font-family: var(--#{$prefix}body-font-family);
@include font-size(var(--#{$prefix}body-font-size));
@ -63,30 +63,30 @@ body {
background-color: var(--#{$prefix}body-bg); // 2
-webkit-text-size-adjust: 100%; // 3
-webkit-tap-highlight-color: rgba($black, 0); // 4
}
// scss-docs-end reboot-body-rules
}
// scss-docs-end reboot-body-rules
// Content grouping
//
// 1. Reset Firefox's gray color
// Content grouping
//
// 1. Reset Firefox's gray color
hr {
hr {
margin: $hr-margin-y 0;
color: $hr-color; // 1
border: 0;
border-top: $hr-border-width solid $hr-border-color;
opacity: $hr-opacity;
}
}
// Typography
//
// 1. Remove top margins from headings
// By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
// margin for easier control within type scales as it avoids margin collapsing.
// Typography
//
// 1. Remove top margins from headings
// By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
// margin for easier control within type scales as it avoids margin collapsing.
%heading {
%heading {
margin-top: 0; // 1
margin-bottom: $headings-margin-bottom;
font-family: $headings-font-family;
@ -94,168 +94,168 @@ hr {
font-weight: $headings-font-weight;
line-height: $headings-line-height;
color: var(--#{$prefix}heading-color);
}
}
h1,
.h1 {
h1,
.h1 {
@extend %heading;
@include font-size($h1-font-size);
}
}
h2,
.h2 {
h2,
.h2 {
@extend %heading;
@include font-size($h2-font-size);
}
}
h3,
.h3 {
h3,
.h3 {
@extend %heading;
@include font-size($h3-font-size);
}
}
h4,
.h4 {
h4,
.h4 {
@extend %heading;
@include font-size($h4-font-size);
}
}
h5,
.h5 {
h5,
.h5 {
@extend %heading;
@include font-size($h5-font-size);
}
}
h6,
.h6 {
h6,
.h6 {
@extend %heading;
@include font-size($h6-font-size);
}
}
// Reset margins on paragraphs
//
// Similarly, the top margin on `<p>`s get reset. However, we also reset the
// bottom margin to use `rem` units instead of `em`.
// Reset margins on paragraphs
//
// Similarly, the top margin on `<p>`s get reset. However, we also reset the
// bottom margin to use `rem` units instead of `em`.
p {
p {
margin-top: 0;
margin-bottom: $paragraph-margin-bottom;
}
}
// Abbreviations
//
// 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
// 2. Add explicit cursor to indicate changed behavior.
// 3. Prevent the text-decoration to be skipped.
// Abbreviations
//
// 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
// 2. Add explicit cursor to indicate changed behavior.
// 3. Prevent the text-decoration to be skipped.
abbr[title] {
abbr[title] {
text-decoration: underline dotted; // 1
cursor: help; // 2
text-decoration-skip-ink: none; // 3
}
}
// Address
// Address
address {
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
}
// Lists
// Lists
ol,
ul {
ol,
ul {
padding-left: 2rem;
}
}
ol,
ul,
dl {
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
}
ol ol,
ul ul,
ol ul,
ul ol {
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
}
dt {
dt {
font-weight: $dt-font-weight;
}
}
// 1. Undo browser default
// 1. Undo browser default
dd {
dd {
margin-bottom: .5rem;
margin-left: 0; // 1
}
}
// Blockquote
// Blockquote
blockquote {
blockquote {
margin: 0 0 1rem;
}
}
// Strong
//
// Add the correct font weight in Chrome, Edge, and Safari
// Strong
//
// Add the correct font weight in Chrome, Edge, and Safari
b,
strong {
b,
strong {
font-weight: $font-weight-bolder;
}
}
// Small
//
// Add the correct font size in all browsers
// Small
//
// Add the correct font size in all browsers
small,
.small {
small,
.small {
@include font-size($small-font-size);
}
}
// Mark
// Mark
mark,
.mark {
mark,
.mark {
padding: $mark-padding;
color: var(--#{$prefix}highlight-color);
background-color: var(--#{$prefix}highlight-bg);
}
}
// Sub and Sup
//
// Prevent `sub` and `sup` elements from affecting the line height in
// all browsers.
// Sub and Sup
//
// Prevent `sub` and `sup` elements from affecting the line height in
// all browsers.
sub,
sup {
sub,
sup {
position: relative;
@include font-size($sub-sup-font-size);
line-height: 0;
vertical-align: baseline;
}
}
sub { bottom: -.25em; }
sup { top: -.5em; }
sub { bottom: -.25em; }
sup { top: -.5em; }
// Links
// Links
a {
a {
color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));
text-decoration: $link-decoration;
@ -263,37 +263,37 @@ a {
--#{$prefix}link-color-rgb: var(--#{$prefix}link-hover-color-rgb);
text-decoration: $link-hover-decoration;
}
}
}
// And undo these styles for placeholder links/named anchors (without href).
// It would be more straightforward to just use a[href] in previous block, but that
// causes specificity issues in many other styles that are too complex to fix.
// See https://github.com/twbs/bootstrap/issues/19402
// And undo these styles for placeholder links/named anchors (without href).
// It would be more straightforward to just use a[href] in previous block, but that
// causes specificity issues in many other styles that are too complex to fix.
// See https://github.com/twbs/bootstrap/issues/19402
a:not([href]):not([class]) {
a:not([href]):not([class]) {
&,
&:hover {
color: inherit;
text-decoration: none;
}
}
}
// Code
// Code
pre,
code,
kbd,
samp {
pre,
code,
kbd,
samp {
font-family: $font-family-code;
@include font-size(1em); // Correct the odd `em` font sizing in all browsers.
}
}
// 1. Remove browser default top margin
// 2. Reset browser default of `1em` to use `rem`s
// 3. Don't allow content to break outside
// 1. Remove browser default top margin
// 2. Reset browser default of `1em` to use `rem`s
// 3. Don't allow content to break outside
pre {
pre {
display: block;
margin-top: 0; // 1
margin-bottom: 1rem; // 2
@ -307,9 +307,9 @@ pre {
color: inherit;
word-break: normal;
}
}
}
code {
code {
@include font-size($code-font-size);
color: var(--#{$prefix}code-color);
word-wrap: break-word;
@ -318,9 +318,9 @@ code {
a > & {
color: inherit;
}
}
}
kbd {
kbd {
padding: $kbd-padding-y $kbd-padding-x;
@include font-size($kbd-font-size);
color: $kbd-color;
@ -332,115 +332,115 @@ kbd {
@include font-size(1em);
font-weight: inherit; // mdo-do: check if this is needed
}
}
}
// Figures
//
// Apply a consistent margin strategy (matches our type styles).
// Figures
//
// Apply a consistent margin strategy (matches our type styles).
figure {
figure {
margin: 0 0 1rem;
}
}
// Images and content
// Images and content
img,
svg {
img,
svg {
vertical-align: middle;
}
}
// Tables
//
// Prevent double borders
// Tables
//
// Prevent double borders
table {
table {
caption-side: bottom;
border-collapse: collapse;
}
}
caption {
caption {
padding-top: $table-cell-padding-y;
padding-bottom: $table-cell-padding-y;
color: $table-caption-color;
text-align: left;
}
}
// 1. Removes font-weight bold by inheriting
// 2. Matches default `<td>` alignment by inheriting `text-align`.
// 3. Fix alignment for Safari
// 1. Removes font-weight bold by inheriting
// 2. Matches default `<td>` alignment by inheriting `text-align`.
// 3. Fix alignment for Safari
th {
th {
font-weight: $table-th-font-weight; // 1
text-align: inherit; // 2
text-align: -webkit-match-parent; // 3
}
}
thead,
tbody,
tfoot,
tr,
td,
th {
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
}
// Forms
//
// 1. Allow labels to use `margin` for spacing.
// Forms
//
// 1. Allow labels to use `margin` for spacing.
label {
label {
display: inline-block; // 1
}
}
// Remove the default `border-radius` that macOS Chrome adds.
// See https://github.com/twbs/bootstrap/issues/24093
// Remove the default `border-radius` that macOS Chrome adds.
// See https://github.com/twbs/bootstrap/issues/24093
button {
button {
// stylelint-disable-next-line property-disallowed-list
border-radius: 0;
}
}
// Explicitly remove focus outline in Chromium when it shouldn't be
// visible (e.g. as result of mouse click or touch tap). It already
// should be doing this automatically, but seems to currently be
// confused and applies its very visible two-tone outline anyway.
// Explicitly remove focus outline in Chromium when it shouldn't be
// visible (e.g. as result of mouse click or touch tap). It already
// should be doing this automatically, but seems to currently be
// confused and applies its very visible two-tone outline anyway.
button:focus:not(:focus-visible) {
button:focus:not(:focus-visible) {
outline: 0;
}
}
// 1. Remove the margin in Firefox and Safari
// 1. Remove the margin in Firefox and Safari
input,
button,
select,
optgroup,
textarea {
input,
button,
select,
optgroup,
textarea {
margin: 0; // 1
font-family: inherit;
@include font-size(inherit);
line-height: inherit;
}
}
// Remove the inheritance of text transform in Firefox
button,
select {
// Remove the inheritance of text transform in Firefox
button,
select {
text-transform: none;
}
// Set the cursor for non-`<button>` buttons
//
// Details at https://github.com/twbs/bootstrap/pull/30562
[role="button"] {
}
// Set the cursor for non-`<button>` buttons
//
// Details at https://github.com/twbs/bootstrap/pull/30562
[role="button"] {
cursor: pointer;
}
}
select {
select {
// Remove the inheritance of word-wrap in Safari.
// See https://github.com/twbs/bootstrap/issues/24990
word-wrap: normal;
@ -449,24 +449,24 @@ select {
&:disabled {
opacity: 1;
}
}
}
// Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
// See https://stackoverflow.com/a/54997118
// Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
// See https://stackoverflow.com/a/54997118
[list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="time"])::-webkit-calendar-picker-indicator {
[list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="time"])::-webkit-calendar-picker-indicator {
display: none !important;
}
}
// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
// controls in Android 4.
// 2. Correct the inability to style clickable types in iOS and Safari.
// 3. Opinionated: add "hand" cursor to non-disabled button elements.
// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
// controls in Android 4.
// 2. Correct the inability to style clickable types in iOS and Safari.
// 3. Opinionated: add "hand" cursor to non-disabled button elements.
button,
[type="button"], // 1
[type="reset"],
[type="submit"] {
button,
[type="button"], // 1
[type="reset"],
[type="submit"] {
-webkit-appearance: button; // 2
@if $enable-button-pointers {
@ -474,41 +474,41 @@ button,
cursor: pointer; // 3
}
}
}
}
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
::-moz-focus-inner {
::-moz-focus-inner {
padding: 0;
border-style: none;
}
}
// 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
// 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
textarea {
textarea {
resize: vertical; // 1
}
}
// 1. Browsers set a default `min-width: min-content;` on fieldsets,
// unlike e.g. `<div>`s, which have `min-width: 0;` by default.
// So we reset that to ensure fieldsets behave more like a standard block element.
// See https://github.com/twbs/bootstrap/issues/12359
// and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
// 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
// 1. Browsers set a default `min-width: min-content;` on fieldsets,
// unlike e.g. `<div>`s, which have `min-width: 0;` by default.
// So we reset that to ensure fieldsets behave more like a standard block element.
// See https://github.com/twbs/bootstrap/issues/12359
// and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
// 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
fieldset {
fieldset {
min-width: 0; // 1
padding: 0; // 2
margin: 0; // 2
border: 0; // 2
}
}
// 1. By using `float: left`, the legend will behave like a block element.
// This way the border of a fieldset wraps around the legend if present.
// 2. Fix wrapping bug.
// See https://github.com/twbs/bootstrap/issues/29712
// 1. By using `float: left`, the legend will behave like a block element.
// This way the border of a fieldset wraps around the legend if present.
// 2. Fix wrapping bug.
// See https://github.com/twbs/bootstrap/issues/29712
legend {
legend {
float: left; // 1
width: 100%;
padding: 0;
@ -520,32 +520,32 @@ legend {
+ * {
clear: left; // 2
}
}
}
// Fix height of inputs with a type of datetime-local, date, month, week, or time
// See https://github.com/twbs/bootstrap/issues/18842
// Fix height of inputs with a type of datetime-local, date, month, week, or time
// See https://github.com/twbs/bootstrap/issues/18842
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
}
::-webkit-inner-spin-button {
::-webkit-inner-spin-button {
height: auto;
}
}
// 1. This overrides the extra rounded corners on search inputs in iOS so that our
// `.form-control` class can properly style them. Note that this cannot simply
// be added to `.form-control` as it's not specific enough. For details, see
// https://github.com/twbs/bootstrap/issues/11586.
// 2. Correct the outline style in Safari.
// 1. This overrides the extra rounded corners on search inputs in iOS so that our
// `.form-control` class can properly style them. Note that this cannot simply
// be added to `.form-control` as it's not specific enough. For details, see
// https://github.com/twbs/bootstrap/issues/11586.
// 2. Correct the outline style in Safari.
[type="search"] {
[type="search"] {
-webkit-appearance: textfield; // 1
outline-offset: -2px; // 2
@ -554,78 +554,79 @@ legend {
cursor: pointer;
filter: grayscale(1);
}
}
}
// 1. A few input types should stay LTR
// See https://rtlstyling.com/posts/rtl-styling#form-inputs
// 2. RTL only output
// See https://rtlcss.com/learn/usage-guide/control-directives/#raw
// 1. A few input types should stay LTR
// See https://rtlstyling.com/posts/rtl-styling#form-inputs
// 2. RTL only output
// See https://rtlcss.com/learn/usage-guide/control-directives/#raw
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
}
*/
// Remove the inner padding in Chrome and Safari on macOS.
// Remove the inner padding in Chrome and Safari on macOS.
::-webkit-search-decoration {
::-webkit-search-decoration {
-webkit-appearance: none;
}
}
// Remove padding around color pickers in webkit browsers
// Remove padding around color pickers in webkit browsers
::-webkit-color-swatch-wrapper {
::-webkit-color-swatch-wrapper {
padding: 0;
}
}
// 1. Inherit font family and line height for file input buttons
// 2. Correct the inability to style clickable types in iOS and Safari.
// 1. Inherit font family and line height for file input buttons
// 2. Correct the inability to style clickable types in iOS and Safari.
::file-selector-button {
::file-selector-button {
font: inherit; // 1
-webkit-appearance: button; // 2
}
}
// Correct element displays
// Correct element displays
output {
output {
display: inline-block;
}
}
// Remove border from iframe
// Remove border from iframe
iframe {
iframe {
border: 0;
}
}
// Summary
//
// 1. Add the correct display in all browsers
// Summary
//
// 1. Add the correct display in all browsers
summary {
summary {
display: list-item; // 1
cursor: pointer;
}
}
// Progress
//
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
// Progress
//
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
progress {
progress {
vertical-align: baseline;
}
}
// Hidden attribute
//
// Always hide an element with the `hidden` HTML attribute.
// Hidden attribute
//
// Always hide an element with the `hidden` HTML attribute.
[hidden] {
[hidden] {
display: none !important;
}
}

View File

@ -36,7 +36,8 @@
// Basic Bootstrap table
//
.table {
@layer content {
.table {
// Reset needed for nesting tables
--#{$prefix}table-color-type: initial;
--#{$prefix}table-bg-type: initial;
@ -80,43 +81,43 @@
> thead {
vertical-align: bottom;
}
}
}
.table-group-divider {
.table-group-divider {
border-top: calc(#{$table-border-width} * 2) solid $table-group-separator-color;
}
}
//
// Change placement of captions with a class
//
//
// Change placement of captions with a class
//
.caption-top {
.caption-top {
caption-side: top;
}
}
//
// Condensed table w/ half padding
//
//
// Condensed table w/ half padding
//
.table-sm {
.table-sm {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
padding: $table-cell-padding-y-sm $table-cell-padding-x-sm;
}
}
}
// Border versions
//
// Add or remove borders all around the table and between all the columns.
//
// When borders are added on all sides of the cells, the corners can render odd when
// these borders do not have the same color or if they are semi-transparent.
// Therefore we add top and border bottoms to the `tr`s and left and right borders
// to the `td`s or `th`s
// Border versions
//
// Add or remove borders all around the table and between all the columns.
//
// When borders are added on all sides of the cells, the corners can render odd when
// these borders do not have the same color or if they are semi-transparent.
// Therefore we add top and border bottoms to the `tr`s and left and right borders
// to the `td`s or `th`s
.table-bordered {
.table-bordered {
> :not(caption) > * {
border-width: $table-border-width 0;
@ -125,9 +126,9 @@
border-width: 0 $table-border-width;
}
}
}
}
.table-borderless {
.table-borderless {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
border-bottom-width: 0;
@ -136,64 +137,64 @@
> :not(:first-child) {
border-top-width: 0;
}
}
}
// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
// For rows
.table-striped {
// For rows
.table-striped {
> tbody > tr:nth-of-type(#{$table-striped-order}) > * {
--#{$prefix}table-color-type: var(--#{$prefix}table-striped-color);
--#{$prefix}table-bg-type: var(--#{$prefix}table-striped-bg);
}
}
}
// For columns
.table-striped-columns {
// For columns
.table-striped-columns {
> :not(caption) > tr > :nth-child(#{$table-striped-columns-order}) {
--#{$prefix}table-color-type: var(--#{$prefix}table-striped-color);
--#{$prefix}table-bg-type: var(--#{$prefix}table-striped-bg);
}
}
}
// Active table
//
// The `.table-active` class can be added to highlight rows or cells
// Active table
//
// The `.table-active` class can be added to highlight rows or cells
.table-active {
.table-active {
--#{$prefix}table-color-state: var(--#{$prefix}table-active-color);
--#{$prefix}table-bg-state: var(--#{$prefix}table-active-bg);
}
}
// Hover effect
//
// Placed here since it has to come after the potential zebra striping
// Hover effect
//
// Placed here since it has to come after the potential zebra striping
.table-hover {
.table-hover {
> tbody > tr:hover > * {
--#{$prefix}table-color-state: var(--#{$prefix}table-hover-color);
--#{$prefix}table-bg-state: var(--#{$prefix}table-hover-bg);
}
}
}
// Table variants
//
// Table variants set the table cell backgrounds, border colors
// and the colors of the striped, hovered & active tables
// Table variants
//
// Table variants set the table cell backgrounds, border colors
// and the colors of the striped, hovered & active tables
@each $color, $value in $table-variants {
@each $color, $value in $table-variants {
@include table-variant($color, $value);
}
}
// Responsive tables
//
// Generate series of `.table-responsive-*` classes for configuring the screen
// size of where your table will overflow.
// Responsive tables
//
// Generate series of `.table-responsive-*` classes for configuring the screen
// size of where your table will overflow.
@each $breakpoint in map.keys($grid-breakpoints) {
@each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-down($breakpoint) {
@ -202,4 +203,5 @@
-webkit-overflow-scrolling: touch;
}
}
}
}

View File

@ -3,13 +3,14 @@
@use "../mixins/lists" as *;
@use "../vendor/rfs" as *;
.lead {
@layer content {
.lead {
@include font-size($lead-font-size);
font-weight: $lead-font-weight;
}
}
// Type display classes
@each $display, $font-size in $display-font-sizes {
// Type display classes
@each $display, $font-size in $display-font-sizes {
.display-#{$display} {
font-family: $display-font-family;
font-style: $display-font-style;
@ -17,50 +18,50 @@
line-height: $display-line-height;
@include font-size($font-size);
}
}
}
//
// Lists
//
//
// Lists
//
.list-unstyled {
.list-unstyled {
@include list-unstyled();
}
}
// Inline turns list items into inline-block
.list-inline {
// Inline turns list items into inline-block
.list-inline {
@include list-unstyled();
}
.list-inline-item {
}
.list-inline-item {
display: inline-block;
&:not(:last-child) {
margin-right: $list-inline-padding;
}
}
}
//
// Misc
//
//
// Misc
//
// Builds on `abbr`
.initialism {
// Builds on `abbr`
.initialism {
@include font-size($initialism-font-size);
text-transform: uppercase;
}
}
// Blockquotes
.blockquote {
// Blockquotes
.blockquote {
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-font-size);
> :last-child {
margin-bottom: 0;
}
}
}
.blockquote-footer {
.blockquote-footer {
margin-top: -$blockquote-margin-y;
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-footer-font-size);
@ -69,4 +70,5 @@
&::before {
content: "\2014\00A0"; // em dash, nbsp
}
}
}

View File

@ -3,7 +3,8 @@
@use "../mixins/border-radius" as *;
@use "../mixins/transition" as *;
.form-floating {
@layer forms {
.form-floating {
position: relative;
> .form-control,
@ -99,4 +100,5 @@
> .form-control:disabled ~ label { // Required for `.form-control`s because of specificity
color: $form-floating-label-disabled-color;
}
}
}

View File

@ -11,7 +11,8 @@
// Check/radio
//
.form-check {
@layer forms {
.form-check {
display: block;
min-height: $form-check-min-height;
padding-left: $form-check-padding-start;
@ -21,9 +22,9 @@
float: left;
margin-left: $form-check-padding-start * -1;
}
}
}
.form-check-reverse {
.form-check-reverse {
padding-right: $form-check-padding-start;
padding-left: 0;
text-align: right;
@ -33,9 +34,9 @@
margin-right: $form-check-padding-start * -1;
margin-left: 0;
}
}
}
.form-check-input {
.form-check-input {
--#{$prefix}form-check-bg: #{$form-check-input-bg};
flex-shrink: 0;
@ -119,18 +120,18 @@
opacity: $form-check-label-disabled-opacity;
}
}
}
}
.form-check-label {
.form-check-label {
color: $form-check-label-color;
cursor: $form-check-label-cursor;
}
}
//
// Switch
//
//
// Switch
//
.form-switch {
.form-switch {
padding-left: $form-switch-padding-start;
.form-check-input {
@ -167,14 +168,14 @@
margin-left: 0;
}
}
}
}
.form-check-inline {
.form-check-inline {
display: inline-block;
margin-right: $form-check-inline-margin-end;
}
}
.btn-check {
.btn-check {
position: absolute;
clip: rect(0, 0, 0, 0);
pointer-events: none;
@ -187,12 +188,13 @@
opacity: $form-check-btn-check-disabled-opacity;
}
}
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark) {
.form-switch .form-check-input:not(:checked):not(:focus) {
--#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
}
}
}
}

View File

@ -10,7 +10,8 @@
// General form controls (plus a few specific high-level interventions)
//
.form-control {
@layer forms {
.form-control {
display: block;
width: 100%;
padding: $input-padding-y $input-padding-x;
@ -118,14 +119,14 @@
&:hover:not(:disabled):not([readonly])::file-selector-button {
background-color: $form-file-button-hover-bg;
}
}
}
// Readonly controls as plain text
//
// Apply class to a readonly input to make it appear like regular plain
// text (without any border, background color, focus indicator)
// Readonly controls as plain text
//
// Apply class to a readonly input to make it appear like regular plain
// text (without any border, background color, focus indicator)
.form-control-plaintext {
.form-control-plaintext {
display: block;
width: 100%;
padding: $input-padding-y 0;
@ -145,16 +146,16 @@
padding-right: 0;
padding-left: 0;
}
}
}
// Form control sizing
//
// Build on `.form-control` with modifier classes to decrease or increase the
// height and font-size of form controls.
//
// Repeated in `_input_group.scss` to avoid Sass extend issues.
// Form control sizing
//
// Build on `.form-control` with modifier classes to decrease or increase the
// height and font-size of form controls.
//
// Repeated in `_input_group.scss` to avoid Sass extend issues.
.form-control-sm {
.form-control-sm {
min-height: $input-height-sm;
padding: $input-padding-y-sm $input-padding-x-sm;
@include font-size($input-font-size-sm);
@ -165,9 +166,9 @@
margin: (-$input-padding-y-sm) (-$input-padding-x-sm);
margin-inline-end: $input-padding-x-sm;
}
}
}
.form-control-lg {
.form-control-lg {
min-height: $input-height-lg;
padding: $input-padding-y-lg $input-padding-x-lg;
@include font-size($input-font-size-lg);
@ -178,12 +179,12 @@
margin: (-$input-padding-y-lg) (-$input-padding-x-lg);
margin-inline-end: $input-padding-x-lg;
}
}
}
// Make sure textareas don't shrink too much when resized
// https://github.com/twbs/bootstrap/pull/29124
// stylelint-disable selector-no-qualifying-type
textarea {
// Make sure textareas don't shrink too much when resized
// https://github.com/twbs/bootstrap/pull/29124
// stylelint-disable selector-no-qualifying-type
textarea {
&.form-control {
min-height: $input-height;
}
@ -195,10 +196,10 @@ textarea {
&.form-control-lg {
min-height: $input-height-lg;
}
}
// stylelint-enable selector-no-qualifying-type
}
// stylelint-enable selector-no-qualifying-type
.form-control-color {
.form-control-color {
width: $form-color-width;
height: $input-height;
padding: $input-padding-y;
@ -219,4 +220,5 @@ textarea {
&.form-control-sm { height: $input-height-sm; }
&.form-control-lg { height: $input-height-lg; }
}
}

View File

@ -10,7 +10,8 @@
// elements cannot be mixed. As such, there are no shared styles for focus or
// active states on prefixed selectors.
.form-range {
@layer forms {
.form-range {
width: 100%;
height: add($form-range-thumb-height, $form-range-thumb-focus-box-shadow-width * 2);
padding: 0; // Need to reset padding
@ -94,4 +95,5 @@
background-color: $form-range-thumb-disabled-bg;
}
}
}
}

View File

@ -11,7 +11,8 @@
// Replaces the browser default select with a custom one, mostly pulled from
// https://primer.github.io/.
.form-select {
@layer forms {
.form-select {
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator)};
display: block;
@ -61,28 +62,29 @@
color: transparent;
text-shadow: 0 0 0 $form-select-color;
}
}
}
.form-select-sm {
.form-select-sm {
padding-top: $form-select-padding-y-sm;
padding-bottom: $form-select-padding-y-sm;
padding-left: $form-select-padding-x-sm;
@include font-size($form-select-font-size-sm);
@include border-radius($form-select-border-radius-sm);
}
}
.form-select-lg {
.form-select-lg {
padding-top: $form-select-padding-y-lg;
padding-bottom: $form-select-padding-y-lg;
padding-left: $form-select-padding-x-lg;
@include font-size($form-select-font-size-lg);
@include border-radius($form-select-border-radius-lg);
}
}
@if $enable-dark-mode {
@if $enable-dark-mode {
@include color-mode(dark) {
.form-select {
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
}
}
}
}

View File

@ -4,10 +4,12 @@
// Form text
//
.form-text {
@layer forms {
.form-text {
margin-top: $form-text-margin-top;
@include font-size($form-text-font-size);
font-style: $form-text-font-style;
font-weight: $form-text-font-weight;
color: $form-text-color;
}
}

View File

@ -8,7 +8,8 @@
// Base styles
//
.input-group {
@layer forms {
.input-group {
position: relative;
display: flex;
flex-wrap: wrap; // For form validation feedback
@ -42,15 +43,15 @@
z-index: 5;
}
}
}
}
// Textual addons
//
// Serves as a catch-all element for any text or radio/checkbox input you wish
// to prepend or append to an input.
// Textual addons
//
// Serves as a catch-all element for any text or radio/checkbox input you wish
// to prepend or append to an input.
.input-group-text {
.input-group-text {
display: flex;
align-items: center;
padding: $input-group-addon-padding-y $input-group-addon-padding-x;
@ -63,46 +64,46 @@
background-color: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color;
@include border-radius($input-border-radius);
}
}
// Sizing
//
// Remix the default form control sizing classes into new ones for easier
// manipulation.
// Sizing
//
// Remix the default form control sizing classes into new ones for easier
// manipulation.
.input-group-lg > .form-control,
.input-group-lg > .form-select,
.input-group-lg > .input-group-text,
.input-group-lg > .btn {
.input-group-lg > .form-control,
.input-group-lg > .form-select,
.input-group-lg > .input-group-text,
.input-group-lg > .btn {
padding: $input-padding-y-lg $input-padding-x-lg;
@include font-size($input-font-size-lg);
@include border-radius($input-border-radius-lg);
}
}
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
padding: $input-padding-y-sm $input-padding-x-sm;
@include font-size($input-font-size-sm);
@include border-radius($input-border-radius-sm);
}
}
.input-group-lg > .form-select,
.input-group-sm > .form-select {
.input-group-lg > .form-select,
.input-group-sm > .form-select {
padding-right: $form-select-padding-x + $form-select-indicator-padding;
}
}
// Rounded corners
//
// These rulesets must come after the sizing ones to properly override sm and lg
// border-radius values when extending. They're more specific than we'd like
// with the `.input-group >` part, but without it, we cannot override the sizing.
// Rounded corners
//
// These rulesets must come after the sizing ones to properly override sm and lg
// border-radius values when extending. They're more specific than we'd like
// with the `.input-group >` part, but without it, we cannot override the sizing.
// stylelint-disable-next-line no-duplicate-selectors
.input-group {
// stylelint-disable-next-line no-duplicate-selectors
.input-group {
&:not(.has-validation) {
> :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
> .dropdown-toggle:nth-last-child(n + 3),
@ -135,4 +136,5 @@
> .form-floating:not(:first-child) > .form-select {
@include border-start-radius(0);
}
}
}

View File

@ -4,17 +4,18 @@
// Labels
//
.form-label {
@layer forms {
.form-label {
margin-bottom: $form-label-margin-bottom;
@include font-size($form-label-font-size);
font-style: $form-label-font-style;
font-weight: $form-label-font-weight;
color: $form-label-color;
}
}
// For use with horizontal and inline forms, when you need the label (or legend)
// text to align with the form controls.
.col-form-label {
// For use with horizontal and inline forms, when you need the label (or legend)
// text to align with the form controls.
.col-form-label {
padding-top: add($input-padding-y, $input-border-width);
padding-bottom: add($input-padding-y, $input-border-width);
margin-bottom: 0; // Override the `<legend>` default
@ -23,16 +24,17 @@
font-weight: $form-label-font-weight;
line-height: $input-line-height;
color: $form-label-color;
}
}
.col-form-label-lg {
.col-form-label-lg {
padding-top: add($input-padding-y-lg, $input-border-width);
padding-bottom: add($input-padding-y-lg, $input-border-width);
@include font-size($input-font-size-lg);
}
}
.col-form-label-sm {
.col-form-label-sm {
padding-top: add($input-padding-y-sm, $input-border-width);
padding-bottom: add($input-padding-y-sm, $input-border-width);
@include font-size($input-font-size-sm);
}
}

View File

@ -175,9 +175,10 @@
}
// scss-docs-end form-validation-mixins
// scss-docs-start form-validation-states-loop
@each $state, $data in $form-validation-states {
@layer forms {
// scss-docs-start form-validation-states-loop
@each $state, $data in $form-validation-states {
@include form-validation-state($state, $data...);
}
// scss-docs-end form-validation-states-loop
}
// scss-docs-end form-validation-states-loop

View File

@ -2,10 +2,12 @@
@use "../config" as *;
@use "../variables" as *;
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
@each $color, $value in $theme-colors {
@layer helpers {
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
@each $color, $value in $theme-colors {
.text-bg-#{$color} {
color: color-contrast($value) if($enable-important-utilities, !important, null);
background-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
}
}
}

View File

@ -1,7 +1,9 @@
@use "../config" as *;
.focus-ring:focus {
@layer helpers {
.focus-ring:focus {
outline: 0;
// By default, there is no `--bs-focus-ring-x`, `--bs-focus-ring-y`, or `--bs-focus-ring-blur`, but we provide CSS variables with fallbacks to initial `0` values
box-shadow: var(--#{$prefix}focus-ring-x, 0) var(--#{$prefix}focus-ring-y, 0) var(--#{$prefix}focus-ring-blur, 0) var(--#{$prefix}focus-ring-width) var(--#{$prefix}focus-ring-color);
}
}

View File

@ -2,7 +2,8 @@
@use "../variables" as *;
@use "../mixins/transition" as *;
.icon-link {
@layer helpers {
.icon-link {
display: inline-flex;
gap: $icon-link-gap;
align-items: center;
@ -17,13 +18,14 @@
fill: currentcolor;
@include transition($icon-link-icon-transition);
}
}
}
.icon-link-hover {
.icon-link-hover {
&:hover,
&:focus-visible {
> .bi {
transform: var(--#{$prefix}icon-link-transform, $icon-link-icon-transform);
}
}
}
}

View File

@ -3,26 +3,25 @@
@use "../variables" as *;
@use "../layout/breakpoints" as *;
// Shorthand
.fixed-top {
@layer helpers {
.fixed-top {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: $zindex-fixed;
}
}
.fixed-bottom {
.fixed-bottom {
position: fixed;
right: 0;
bottom: 0;
left: 0;
z-index: $zindex-fixed;
}
}
// Responsive sticky top and bottom
@each $breakpoint in map.keys($grid-breakpoints) {
// Responsive sticky top and bottom
@each $breakpoint in map.keys($grid-breakpoints) {
@include media-breakpoint-up($breakpoint) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@ -38,4 +37,5 @@
z-index: $zindex-sticky;
}
}
}
}

View File

@ -1,15 +1,17 @@
// scss-docs-start stacks
.hstack {
@layer helpers {
// scss-docs-start stacks
.hstack {
display: flex;
flex-direction: row;
align-items: center;
align-self: stretch;
}
}
.vstack {
.vstack {
display: flex;
flex: 1 1 auto;
flex-direction: column;
align-self: stretch;
}
// scss-docs-end stacks
}
// scss-docs-end stacks

View File

@ -1,10 +1,7 @@
@use "../variables" as *;
//
// Stretched link
//
.stretched-link {
@layer helpers {
.stretched-link {
&::#{$stretched-link-pseudo-element} {
position: absolute;
top: 0;
@ -14,4 +11,5 @@
z-index: $stretched-link-z-index;
content: "";
}
}
}

View File

@ -1,7 +1,7 @@
@use "../mixins/text-truncate" as *;
// Text truncation
//
.text-truncate {
@layer helpers {
.text-truncate {
@include text-truncate();
}
}

View File

@ -1,10 +1,8 @@
@use "../mixins/visually-hidden" as *;
//
// Visually hidden
//
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
@layer helpers {
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
@include visually-hidden();
}
}

View File

@ -1,10 +1,12 @@
@use "../variables" as *;
.vr {
@layer helpers {
.vr {
display: inline-block;
align-self: stretch;
width: $vr-border-width;
min-height: 1em;
background-color: currentcolor;
opacity: $hr-opacity;
}
}

View File

@ -16,7 +16,8 @@
margin-left: auto;
}
@if $enable-container-classes {
@layer layout {
@if $enable-container-classes {
// Single container class with breakpoint max-widths
.container,
// 100% wide container at all breakpoints
@ -52,4 +53,5 @@
}
}
}
}
}

View File

@ -15,7 +15,8 @@
}
}
.grid {
@layer layout {
.grid {
--#{$prefix}columns: #{$grid-columns};
--#{$prefix}rows: 1;
--#{$prefix}gap: #{$grid-gutter-width};
@ -24,9 +25,9 @@
grid-template-rows: repeat(var(--#{$prefix}rows), 1fr);
grid-template-columns: repeat(var(--#{$prefix}columns), 1fr);
gap: var(--#{$prefix}gap);
}
}
@each $breakpoint in map.keys($grid-breakpoints) {
@each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
@ -50,34 +51,35 @@
}
}
}
}
}
// mdo-do: add to utilities?
.grid-cols-subgrid {
// mdo-do: add to utilities?
.grid-cols-subgrid {
grid-template-columns: subgrid;
}
}
.grid-fill {
.grid-fill {
--#{$prefix}gap: #{$grid-gutter-width};
display: grid;
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
grid-auto-flow: row;
gap: var(--#{$prefix}gap);
}
}
// mdo-do: add to utilities?
.g-col-auto {
// mdo-do: add to utilities?
.g-col-auto {
grid-column: auto/auto;
}
}
// mdo-do: add to utilities?
.grid-cols-3 {
// mdo-do: add to utilities?
.grid-cols-3 {
--#{$prefix}columns: 3;
}
.grid-cols-4 {
}
.grid-cols-4 {
--#{$prefix}columns: 4;
}
.grid-cols-6 {
}
.grid-cols-6 {
--#{$prefix}columns: 6;
}
}