Implement CSS layers

Rearrange and comment import stack

Move content stylesheets to new folder
This commit is contained in:
Mark Otto 2025-02-19 23:08:52 -08:00
parent d36b7d5dfc
commit 4d08a84eb1
57 changed files with 5000 additions and 4888 deletions

View File

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

View File

@ -7,7 +7,8 @@
// Base styles // Base styles
// //
.alert { @layer components {
.alert {
// scss-docs-start alert-css-vars // scss-docs-start alert-css-vars
--#{$prefix}alert-bg: transparent; --#{$prefix}alert-bg: transparent;
--#{$prefix}alert-padding-x: #{$alert-padding-x}; --#{$prefix}alert-padding-x: #{$alert-padding-x};
@ -27,26 +28,26 @@
background-color: var(--#{$prefix}alert-bg); background-color: var(--#{$prefix}alert-bg);
border: var(--#{$prefix}alert-border); border: var(--#{$prefix}alert-border);
@include border-radius(var(--#{$prefix}alert-border-radius)); @include border-radius(var(--#{$prefix}alert-border-radius));
} }
// Headings for larger alerts // Headings for larger alerts
.alert-heading { .alert-heading {
// Specified to prevent conflicts of changing $headings-color // Specified to prevent conflicts of changing $headings-color
color: inherit; color: inherit;
} }
// Provide class for links that match alerts // Provide class for links that match alerts
.alert-link { .alert-link {
font-weight: $alert-link-font-weight; font-weight: $alert-link-font-weight;
color: var(--#{$prefix}alert-link-color); color: var(--#{$prefix}alert-link-color);
} }
// Dismissible alerts // Dismissible alerts
// //
// Expand the right padding and account for the close button's positioning. // Expand the right padding and account for the close button's positioning.
.alert-dismissible { .alert-dismissible {
padding-right: $alert-dismissible-padding-r; padding-right: $alert-dismissible-padding-r;
// Adjust close link position // Adjust close link position
@ -57,17 +58,18 @@
z-index: $stretched-link-z-index + 1; z-index: $stretched-link-z-index + 1;
padding: $alert-padding-y * 1.25 $alert-padding-x; padding: $alert-padding-y * 1.25 $alert-padding-x;
} }
} }
// scss-docs-start alert-modifiers // scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert // Generate contextual modifier classes for colorizing the alert
@each $state in map.keys($theme-colors) { @each $state in map.keys($theme-colors) {
.alert-#{$state} { .alert-#{$state} {
--#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis); --#{$prefix}alert-color: var(--#{$prefix}#{$state}-text-emphasis);
--#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle); --#{$prefix}alert-bg: var(--#{$prefix}#{$state}-bg-subtle);
--#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle); --#{$prefix}alert-border-color: var(--#{$prefix}#{$state}-border-subtle);
--#{$prefix}alert-link-color: var(--#{$prefix}#{$state}-text-emphasis); --#{$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 // Requires one of the contextual, color modifier classes for `color` and
// `background-color`. // `background-color`.
.badge { @layer components {
.badge {
// scss-docs-start badge-css-vars // scss-docs-start badge-css-vars
--#{$prefix}badge-padding-x: #{$badge-padding-x}; --#{$prefix}badge-padding-x: #{$badge-padding-x};
--#{$prefix}badge-padding-y: #{$badge-padding-y}; --#{$prefix}badge-padding-y: #{$badge-padding-y};
@ -35,10 +36,11 @@
&:empty { &:empty {
display: none; display: none;
} }
} }
// Quick fix for badges in buttons // Quick fix for badges in buttons
.btn .badge { .btn .badge {
position: relative; position: relative;
top: -1px; top: -1px;
}
} }

View File

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

View File

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

View File

@ -13,8 +13,9 @@
// Easily pump out default styles, as well as :hover, :focus, :active, // Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons // and disabled options for all buttons
// scss-docs-start btn-variant-mixin @layer components {
@mixin button-variant( // scss-docs-start btn-variant-mixin
@mixin button-variant(
$background, $background,
$border, $border,
$color: color-contrast($background), $color: color-contrast($background),
@ -27,7 +28,7 @@
$disabled-background: $background, $disabled-background: $background,
$disabled-border: $border, $disabled-border: $border,
$disabled-color: color-contrast($disabled-background) $disabled-color: color-contrast($disabled-background)
) { ) {
--#{$prefix}btn-color: #{$color}; --#{$prefix}btn-color: #{$color};
--#{$prefix}btn-bg: #{$background}; --#{$prefix}btn-bg: #{$background};
--#{$prefix}btn-border-color: #{$border}; --#{$prefix}btn-border-color: #{$border};
@ -42,17 +43,17 @@
--#{$prefix}btn-disabled-color: #{$disabled-color}; --#{$prefix}btn-disabled-color: #{$disabled-color};
--#{$prefix}btn-disabled-bg: #{$disabled-background}; --#{$prefix}btn-disabled-bg: #{$disabled-background};
--#{$prefix}btn-disabled-border-color: #{$disabled-border}; --#{$prefix}btn-disabled-border-color: #{$disabled-border};
} }
// scss-docs-end btn-variant-mixin // scss-docs-end btn-variant-mixin
// scss-docs-start btn-outline-variant-mixin // scss-docs-start btn-outline-variant-mixin
@mixin button-outline-variant( @mixin button-outline-variant(
$color, $color,
$color-hover: color-contrast($color), $color-hover: color-contrast($color),
$active-background: $color, $active-background: $color,
$active-border: $color, $active-border: $color,
$active-color: color-contrast($active-background) $active-color: color-contrast($active-background)
) { ) {
--#{$prefix}btn-color: #{$color}; --#{$prefix}btn-color: #{$color};
--#{$prefix}btn-border-color: #{$color}; --#{$prefix}btn-border-color: #{$color};
--#{$prefix}btn-hover-color: #{$color-hover}; --#{$prefix}btn-hover-color: #{$color-hover};
@ -67,24 +68,24 @@
--#{$prefix}btn-disabled-bg: transparent; --#{$prefix}btn-disabled-bg: transparent;
--#{$prefix}btn-disabled-border-color: #{$color}; --#{$prefix}btn-disabled-border-color: #{$color};
--#{$prefix}gradient: none; --#{$prefix}gradient: none;
} }
// scss-docs-end btn-outline-variant-mixin // scss-docs-end btn-outline-variant-mixin
// scss-docs-start btn-size-mixin // scss-docs-start btn-size-mixin
@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) { @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
--#{$prefix}btn-padding-y: #{$padding-y}; --#{$prefix}btn-padding-y: #{$padding-y};
--#{$prefix}btn-padding-x: #{$padding-x}; --#{$prefix}btn-padding-x: #{$padding-x};
@include rfs($font-size, --#{$prefix}btn-font-size); @include rfs($font-size, --#{$prefix}btn-font-size);
--#{$prefix}btn-border-radius: #{$border-radius}; --#{$prefix}btn-border-radius: #{$border-radius};
} }
// scss-docs-end btn-size-mixin // scss-docs-end btn-size-mixin
// //
// Base styles // Base styles
// //
.btn { .btn {
// scss-docs-start btn-css-vars // scss-docs-start btn-css-vars
--#{$prefix}btn-padding-x: #{$btn-padding-x}; --#{$prefix}btn-padding-x: #{$btn-padding-x};
--#{$prefix}btn-padding-y: #{$btn-padding-y}; --#{$prefix}btn-padding-y: #{$btn-padding-y};
@ -202,15 +203,15 @@
opacity: var(--#{$prefix}btn-disabled-opacity); opacity: var(--#{$prefix}btn-disabled-opacity);
@include box-shadow(none); @include box-shadow(none);
} }
} }
// //
// Alternate buttons // Alternate buttons
// //
// scss-docs-start btn-variant-loops // scss-docs-start btn-variant-loops
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.btn-#{$color} { .btn-#{$color} {
@if $color == "light" { @if $color == "light" {
@include button-variant( @include button-variant(
@ -234,22 +235,22 @@
@include button-variant($value, $value); @include button-variant($value, $value);
} }
} }
} }
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.btn-outline-#{$color} { .btn-outline-#{$color} {
@include button-outline-variant($value); @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 // Make a button look and behave like a link
.btn-link { .btn-link {
--#{$prefix}btn-font-weight: #{$font-weight-normal}; --#{$prefix}btn-font-weight: #{$font-weight-normal};
--#{$prefix}btn-color: #{$btn-link-color}; --#{$prefix}btn-color: #{$btn-link-color};
--#{$prefix}btn-bg: transparent; --#{$prefix}btn-bg: transparent;
@ -282,17 +283,18 @@
} }
// No need for an active state here // 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); @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); @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 // Base styles
// //
.card { @layer components {
.card {
// scss-docs-start card-css-vars // scss-docs-start card-css-vars
--#{$prefix}card-spacer-y: #{$card-spacer-y}; --#{$prefix}card-spacer-y: #{$card-spacer-y};
--#{$prefix}card-spacer-x: #{$card-spacer-x}; --#{$prefix}card-spacer-x: #{$card-spacer-x};
@ -70,32 +71,32 @@
> .list-group + .card-footer { > .list-group + .card-footer {
border-top: 0; border-top: 0;
} }
} }
.card-body { .card-body {
// Enable `flex-grow: 1` for decks and groups so that card blocks take up // 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. // as much space as possible, ensuring footers are aligned to the bottom.
flex: 1 1 auto; flex: 1 1 auto;
padding: var(--#{$prefix}card-spacer-y) var(--#{$prefix}card-spacer-x); padding: var(--#{$prefix}card-spacer-y) var(--#{$prefix}card-spacer-x);
color: var(--#{$prefix}card-color); color: var(--#{$prefix}card-color);
} }
.card-title { .card-title {
margin-bottom: var(--#{$prefix}card-title-spacer-y); margin-bottom: var(--#{$prefix}card-title-spacer-y);
color: var(--#{$prefix}card-title-color); color: var(--#{$prefix}card-title-color);
} }
.card-subtitle { .card-subtitle {
margin-top: calc(-.5 * var(--#{$prefix}card-title-spacer-y)); // stylelint-disable-line function-disallowed-list margin-top: calc(-.5 * var(--#{$prefix}card-title-spacer-y)); // stylelint-disable-line function-disallowed-list
margin-bottom: 0; margin-bottom: 0;
color: var(--#{$prefix}card-subtitle-color); color: var(--#{$prefix}card-subtitle-color);
} }
.card-text:last-child { .card-text:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.card-link { .card-link {
&:hover { &:hover {
text-decoration: if($link-hover-decoration == underline, none, null); text-decoration: if($link-hover-decoration == underline, none, null);
} }
@ -103,13 +104,13 @@
+ .card-link { + .card-link {
margin-left: var(--#{$prefix}card-spacer-x); 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); padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x);
margin-bottom: 0; // Removes the default margin-bottom of <hN> margin-bottom: 0; // Removes the default margin-bottom of <hN>
color: var(--#{$prefix}card-cap-color); color: var(--#{$prefix}card-cap-color);
@ -119,9 +120,9 @@
&:first-child { &:first-child {
@include border-radius(var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius) 0 0); @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); padding: var(--#{$prefix}card-cap-padding-y) var(--#{$prefix}card-cap-padding-x);
color: var(--#{$prefix}card-cap-color); color: var(--#{$prefix}card-cap-color);
background-color: var(--#{$prefix}card-cap-bg); background-color: var(--#{$prefix}card-cap-bg);
@ -130,14 +131,14 @@
&:last-child { &:last-child {
@include border-radius(0 0 var(--#{$prefix}card-inner-border-radius) var(--#{$prefix}card-inner-border-radius)); @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)); // stylelint-disable-line function-disallowed-list margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list
margin-bottom: calc(-1 * var(--#{$prefix}card-cap-padding-y)); // stylelint-disable-line function-disallowed-list margin-bottom: calc(-1 * var(--#{$prefix}card-cap-padding-y)); // stylelint-disable-line function-disallowed-list
margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list
@ -147,15 +148,15 @@
background-color: var(--#{$prefix}card-bg); background-color: var(--#{$prefix}card-bg);
border-bottom-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)); // stylelint-disable-line function-disallowed-list margin-right: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list
margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list margin-left: calc(-.5 * var(--#{$prefix}card-cap-padding-x)); // stylelint-disable-line function-disallowed-list
} }
// Card image // Card image
.card-img-overlay { .card-img-overlay {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@ -163,30 +164,30 @@
left: 0; left: 0;
padding: var(--#{$prefix}card-img-overlay-padding); padding: var(--#{$prefix}card-img-overlay-padding);
@include border-radius(var(--#{$prefix}card-inner-border-radius)); @include border-radius(var(--#{$prefix}card-inner-border-radius));
} }
.card-img, .card-img,
.card-img-top, .card-img-top,
.card-img-bottom { .card-img-bottom {
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
} }
.card-img, .card-img,
.card-img-top { .card-img-top {
@include border-top-radius(var(--#{$prefix}card-inner-border-radius)); @include border-top-radius(var(--#{$prefix}card-inner-border-radius));
} }
.card-img, .card-img,
.card-img-bottom { .card-img-bottom {
@include border-bottom-radius(var(--#{$prefix}card-inner-border-radius)); @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` // The child selector allows nested `.card` within `.card-group`
// to display properly. // to display properly.
> .card { > .card {
@ -241,4 +242,5 @@
} }
} }
} }
}
} }

View File

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

View File

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

View File

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

View File

@ -1,49 +0,0 @@
@use "config" as *;
@use "variables" as *;
@use "vendor/rfs" as *;
@use "mixins/image" as *;
@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 {
@include img-fluid();
}
// Image thumbnails
.img-thumbnail {
padding: $thumbnail-padding;
background-color: $thumbnail-bg;
border: $thumbnail-border-width solid $thumbnail-border-color;
@include border-radius($thumbnail-border-radius);
@include box-shadow($thumbnail-box-shadow);
// Keep them at most 100% wide
@include img-fluid();
}
//
// Figures
//
.figure {
// Ensures the caption's text aligns with the image.
display: inline-block;
}
.figure-img {
margin-bottom: $spacer * .5;
line-height: 1;
}
.figure-caption {
@include font-size($figure-caption-font-size);
color: $figure-caption-color;
}

View File

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

@ -16,9 +16,9 @@
// .modal-dialog - positioning shell for the actual modal // .modal-dialog - positioning shell for the actual modal
// .modal-content - actual modal w/ bg and corners and stuff // .modal-content - actual modal w/ bg and corners and stuff
@layer components {
// Container that the modal scrolls within // Container that the modal scrolls within
.modal { .modal {
// scss-docs-start modal-css-vars // scss-docs-start modal-css-vars
--#{$prefix}modal-zindex: #{$zindex-modal}; --#{$prefix}modal-zindex: #{$zindex-modal};
--#{$prefix}modal-width: #{$modal-md}; --#{$prefix}modal-width: #{$modal-md};
@ -58,10 +58,10 @@
// We deliberately don't use `-webkit-overflow-scrolling: touch;` due to a // 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 // gnarly iOS Safari bug: https://bugs.webkit.org/show_bug.cgi?id=158342
// See also https://github.com/twbs/bootstrap/issues/17695 // See also https://github.com/twbs/bootstrap/issues/17695
} }
// Shell div to position the modal with bottom padding // Shell div to position the modal with bottom padding
.modal-dialog { .modal-dialog {
position: relative; position: relative;
width: auto; width: auto;
margin: var(--#{$prefix}modal-margin); margin: var(--#{$prefix}modal-margin);
@ -81,9 +81,9 @@
.modal.modal-static & { .modal.modal-static & {
transform: $modal-scale-transform; transform: $modal-scale-transform;
} }
} }
.modal-dialog-scrollable { .modal-dialog-scrollable {
height: calc(100% - var(--#{$prefix}modal-margin) * 2); height: calc(100% - var(--#{$prefix}modal-margin) * 2);
.modal-content { .modal-content {
@ -94,16 +94,16 @@
.modal-body { .modal-body {
overflow-y: auto; overflow-y: auto;
} }
} }
.modal-dialog-centered { .modal-dialog-centered {
display: flex; display: flex;
align-items: center; align-items: center;
min-height: calc(100% - var(--#{$prefix}modal-margin) * 2); min-height: calc(100% - var(--#{$prefix}modal-margin) * 2);
} }
// Actual modal // Actual modal
.modal-content { .modal-content {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -118,10 +118,10 @@
@include box-shadow(var(--#{$prefix}modal-box-shadow)); @include box-shadow(var(--#{$prefix}modal-box-shadow));
// Remove focus outline from opened modal // Remove focus outline from opened modal
outline: 0; outline: 0;
} }
// Modal background // Modal background
.modal-backdrop { .modal-backdrop {
// scss-docs-start modal-backdrop-css-vars // scss-docs-start modal-backdrop-css-vars
--#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop}; --#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
--#{$prefix}backdrop-bg: #{$modal-backdrop-bg}; --#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
@ -129,11 +129,11 @@
// scss-docs-end modal-backdrop-css-vars // scss-docs-end modal-backdrop-css-vars
@include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity)); @include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity));
} }
// Modal header // Modal header
// Top section of the modal w/ title and dismiss // Top section of the modal w/ title and dismiss
.modal-header { .modal-header {
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
align-items: center; align-items: center;
@ -145,26 +145,26 @@
padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5); padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5);
margin: calc(-.5 * var(--#{$prefix}modal-header-padding-y)) calc(-.5 * var(--#{$prefix}modal-header-padding-x)) calc(-.5 * var(--#{$prefix}modal-header-padding-y)) auto; margin: calc(-.5 * var(--#{$prefix}modal-header-padding-y)) calc(-.5 * var(--#{$prefix}modal-header-padding-x)) calc(-.5 * var(--#{$prefix}modal-header-padding-y)) auto;
} }
} }
// Title text within header // Title text within header
.modal-title { .modal-title {
margin-bottom: 0; margin-bottom: 0;
line-height: var(--#{$prefix}modal-title-line-height); line-height: var(--#{$prefix}modal-title-line-height);
} }
// Modal body // Modal body
// Where all modal content resides (sibling of .modal-header and .modal-footer) // Where all modal content resides (sibling of .modal-header and .modal-footer)
.modal-body { .modal-body {
position: relative; position: relative;
// Enable `flex-grow: 1` so that the body take up as much space as possible // 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`. // when there should be a fixed height on `.modal-dialog`.
flex: 1 1 auto; flex: 1 1 auto;
padding: var(--#{$prefix}modal-padding); padding: var(--#{$prefix}modal-padding);
} }
// Footer (for actions) // Footer (for actions)
.modal-footer { .modal-footer {
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
flex-wrap: wrap; flex-wrap: wrap;
@ -181,10 +181,10 @@
> * { > * {
margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class
} }
} }
// Scale up the modal // Scale up the modal
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
.modal { .modal {
--#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up}; --#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up};
--#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up}; --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up};
@ -200,23 +200,23 @@
.modal-sm { .modal-sm {
--#{$prefix}modal-width: #{$modal-sm}; --#{$prefix}modal-width: #{$modal-sm};
} }
} }
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {
.modal-lg, .modal-lg,
.modal-xl { .modal-xl {
--#{$prefix}modal-width: #{$modal-lg}; --#{$prefix}modal-width: #{$modal-lg};
} }
} }
@include media-breakpoint-up(xl) { @include media-breakpoint-up(xl) {
.modal-xl { .modal-xl {
--#{$prefix}modal-width: #{$modal-xl}; --#{$prefix}modal-width: #{$modal-xl};
} }
} }
// scss-docs-start modal-fullscreen-loop // scss-docs-start modal-fullscreen-loop
@each $breakpoint in map.keys($grid-breakpoints) { @each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
$postfix: if($infix != "", $infix + "-down", ""); $postfix: if($infix != "", $infix + "-down", "");
@ -243,5 +243,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 // Kickstart any navigation component with a set of style resets. Works with
// `<nav>`s, `<ul>`s or `<ol>`s. // `<nav>`s, `<ul>`s or `<ol>`s.
.nav { @layer components {
.nav {
// scss-docs-start nav-css-vars // scss-docs-start nav-css-vars
--#{$prefix}nav-link-padding-x: #{$nav-link-padding-x}; --#{$prefix}nav-link-padding-x: #{$nav-link-padding-x};
--#{$prefix}nav-link-padding-y: #{$nav-link-padding-y}; --#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
@ -26,9 +27,9 @@
padding-left: 0; padding-left: 0;
margin-bottom: 0; margin-bottom: 0;
list-style: none; list-style: none;
} }
.nav-link { .nav-link {
display: block; display: block;
padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x); padding: var(--#{$prefix}nav-link-padding-y) var(--#{$prefix}nav-link-padding-x);
@include font-size(var(--#{$prefix}nav-link-font-size)); @include font-size(var(--#{$prefix}nav-link-font-size));
@ -57,13 +58,13 @@
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;
} }
} }
// //
// Tabs // Tabs
// //
.nav-tabs { .nav-tabs {
// scss-docs-start nav-tabs-css-vars // scss-docs-start nav-tabs-css-vars
--#{$prefix}nav-tabs-border-width: #{$nav-tabs-border-width}; --#{$prefix}nav-tabs-border-width: #{$nav-tabs-border-width};
--#{$prefix}nav-tabs-border-color: #{$nav-tabs-border-color}; --#{$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 // Remove the top rounded corners here since there is a hard edge above the menu
@include border-top-radius(0); @include border-top-radius(0);
} }
} }
// //
// Pills // Pills
// //
.nav-pills { .nav-pills {
// scss-docs-start nav-pills-css-vars // scss-docs-start nav-pills-css-vars
--#{$prefix}nav-pills-border-radius: #{$nav-pills-border-radius}; --#{$prefix}nav-pills-border-radius: #{$nav-pills-border-radius};
--#{$prefix}nav-pills-link-active-color: #{$nav-pills-link-active-color}; --#{$prefix}nav-pills-link-active-color: #{$nav-pills-link-active-color};
@ -125,14 +126,14 @@
color: var(--#{$prefix}nav-pills-link-active-color); color: var(--#{$prefix}nav-pills-link-active-color);
@include gradient-bg(var(--#{$prefix}nav-pills-link-active-bg)); @include gradient-bg(var(--#{$prefix}nav-pills-link-active-bg));
} }
} }
// //
// Underline // Underline
// //
.nav-underline { .nav-underline {
// scss-docs-start nav-underline-css-vars // scss-docs-start nav-underline-css-vars
--#{$prefix}nav-underline-gap: #{$nav-underline-gap}; --#{$prefix}nav-underline-gap: #{$nav-underline-gap};
--#{$prefix}nav-underline-border-width: #{$nav-underline-border-width}; --#{$prefix}nav-underline-border-width: #{$nav-underline-border-width};
@ -158,47 +159,48 @@
color: var(--#{$prefix}nav-underline-link-active-color); color: var(--#{$prefix}nav-underline-link-active-color);
border-bottom-color: currentcolor; border-bottom-color: currentcolor;
} }
} }
// //
// Justified variants // Justified variants
// //
.nav-fill { .nav-fill {
> .nav-link, > .nav-link,
.nav-item { .nav-item {
flex: 1 1 auto; flex: 1 1 auto;
text-align: center; text-align: center;
} }
} }
.nav-justified { .nav-justified {
> .nav-link, > .nav-link,
.nav-item { .nav-item {
flex-grow: 1; flex-grow: 1;
flex-basis: 0; flex-basis: 0;
text-align: center; text-align: center;
} }
} }
.nav-fill, .nav-fill,
.nav-justified { .nav-justified {
.nav-item .nav-link { .nav-item .nav-link {
width: 100%; // Make sure button will grow width: 100%; // Make sure button will grow
} }
} }
// Tabbable tabs // Tabbable tabs
// //
// Hide tabbable panes to start, show them when `.active` // Hide tabbable panes to start, show them when `.active`
.tab-content { .tab-content {
> .tab-pane { > .tab-pane {
display: none; display: none;
} }
> .active { > .active {
display: block; display: block;
} }
}
} }

View File

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

View File

@ -8,7 +8,8 @@
// stylelint-disable function-disallowed-list // stylelint-disable function-disallowed-list
%offcanvas-css-vars { @layer components {
%offcanvas-css-vars {
// scss-docs-start offcanvas-css-vars // scss-docs-start offcanvas-css-vars
--#{$prefix}offcanvas-zindex: #{$zindex-offcanvas}; --#{$prefix}offcanvas-zindex: #{$zindex-offcanvas};
--#{$prefix}offcanvas-width: #{$offcanvas-horizontal-width}; --#{$prefix}offcanvas-width: #{$offcanvas-horizontal-width};
@ -23,18 +24,18 @@
--#{$prefix}offcanvas-transition: #{transform $offcanvas-transition-duration ease-in-out}; --#{$prefix}offcanvas-transition: #{transform $offcanvas-transition-duration ease-in-out};
--#{$prefix}offcanvas-title-line-height: #{$offcanvas-title-line-height}; --#{$prefix}offcanvas-title-line-height: #{$offcanvas-title-line-height};
// scss-docs-end offcanvas-css-vars // scss-docs-end offcanvas-css-vars
} }
@each $breakpoint in map.keys($grid-breakpoints) { @each $breakpoint in map.keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints); $next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints); $infix: breakpoint-infix($next, $grid-breakpoints);
.offcanvas#{$infix} { .offcanvas#{$infix} {
@extend %offcanvas-css-vars; @extend %offcanvas-css-vars;
} }
} }
@each $breakpoint in map.keys($grid-breakpoints) { @each $breakpoint in map.keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints); $next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints); $infix: breakpoint-infix($next, $grid-breakpoints);
@ -122,13 +123,13 @@
} }
} }
} }
} }
.offcanvas-backdrop { .offcanvas-backdrop {
@include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity); @include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
} }
.offcanvas-header { .offcanvas-header {
display: flex; display: flex;
align-items: center; align-items: center;
padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x); padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
@ -137,15 +138,16 @@
padding: calc(var(--#{$prefix}offcanvas-padding-y) * .5) calc(var(--#{$prefix}offcanvas-padding-x) * .5); padding: calc(var(--#{$prefix}offcanvas-padding-y) * .5) calc(var(--#{$prefix}offcanvas-padding-x) * .5);
margin: calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) calc(-.5 * var(--#{$prefix}offcanvas-padding-x)) calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) auto; margin: calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) calc(-.5 * var(--#{$prefix}offcanvas-padding-x)) calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) auto;
} }
} }
.offcanvas-title { .offcanvas-title {
margin-bottom: 0; margin-bottom: 0;
line-height: var(--#{$prefix}offcanvas-title-line-height); line-height: var(--#{$prefix}offcanvas-title-line-height);
} }
.offcanvas-body { .offcanvas-body {
flex-grow: 1; flex-grow: 1;
padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x); padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
overflow-y: auto; overflow-y: auto;
}
} }

View File

@ -15,7 +15,8 @@
} }
// scss-docs-end pagination-mixin // scss-docs-end pagination-mixin
.pagination { @layer components {
.pagination {
// scss-docs-start pagination-css-vars // scss-docs-start pagination-css-vars
--#{$prefix}pagination-padding-x: #{$pagination-padding-x}; --#{$prefix}pagination-padding-x: #{$pagination-padding-x};
--#{$prefix}pagination-padding-y: #{$pagination-padding-y}; --#{$prefix}pagination-padding-y: #{$pagination-padding-y};
@ -41,9 +42,9 @@
display: flex; display: flex;
@include list-unstyled(); @include list-unstyled();
} }
.page-link { .page-link {
position: relative; position: relative;
display: block; display: block;
padding: var(--#{$prefix}pagination-padding-y) var(--#{$prefix}pagination-padding-x); padding: var(--#{$prefix}pagination-padding-y) var(--#{$prefix}pagination-padding-x);
@ -85,9 +86,9 @@
background-color: var(--#{$prefix}pagination-disabled-bg); background-color: var(--#{$prefix}pagination-disabled-bg);
border-color: var(--#{$prefix}pagination-disabled-border-color); border-color: var(--#{$prefix}pagination-disabled-border-color);
} }
} }
.page-item { .page-item {
&:not(:first-child) .page-link { &:not(:first-child) .page-link {
margin-left: $pagination-margin-start; margin-left: $pagination-margin-start;
} }
@ -110,17 +111,18 @@
@include border-radius(var(--#{$prefix}pagination-border-radius)); @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); @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); @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 "colors" as *; @use "colors" as *;
@use "variables" as *; @use "variables" as *;
.placeholder { @layer components {
.placeholder {
display: inline-block; display: inline-block;
min-height: 1em; min-height: 1em;
vertical-align: middle; vertical-align: middle;
@ -14,42 +15,43 @@
display: inline-block; display: inline-block;
content: ""; content: "";
} }
} }
// Sizing // Sizing
.placeholder-xs { .placeholder-xs {
min-height: .6em; min-height: .6em;
} }
.placeholder-sm { .placeholder-sm {
min-height: .8em; min-height: .8em;
} }
.placeholder-lg { .placeholder-lg {
min-height: 1.2em; min-height: 1.2em;
} }
// Animation // Animation
.placeholder-glow { .placeholder-glow {
.placeholder { .placeholder {
animation: placeholder-glow 2s ease-in-out infinite; animation: placeholder-glow 2s ease-in-out infinite;
} }
} }
@keyframes placeholder-glow { @keyframes placeholder-glow {
50% { 50% {
opacity: $placeholder-opacity-min; 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-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%);
mask-size: 200% 100%; mask-size: 200% 100%;
animation: placeholder-wave 2s linear infinite; animation: placeholder-wave 2s linear infinite;
} }
@keyframes placeholder-wave { @keyframes placeholder-wave {
100% { 100% {
mask-position: -200% 0%; mask-position: -200% 0%;
} }
}
} }

View File

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

View File

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

View File

@ -1,617 +0,0 @@
@use "config" as *;
@use "colors" as *;
@use "variables" as *;
@use "vendor/rfs" as *;
@use "mixins/border-radius" as *;
// 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
// Document
//
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
*,
*::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 {
@if $font-size-root != null {
@include font-size(var(--#{$prefix}root-font-size));
}
@if $enable-smooth-scroll {
@media (prefers-reduced-motion: no-preference) {
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.
// 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));
font-weight: var(--#{$prefix}body-font-weight);
line-height: var(--#{$prefix}body-line-height);
color: var(--#{$prefix}body-color);
text-align: var(--#{$prefix}body-text-align);
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
// Content grouping
//
// 1. Reset Firefox's gray color
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.
%heading {
margin-top: 0; // 1
margin-bottom: $headings-margin-bottom;
font-family: $headings-font-family;
font-style: $headings-font-style;
font-weight: $headings-font-weight;
line-height: $headings-line-height;
color: var(--#{$prefix}heading-color);
}
h1 {
@extend %heading;
@include font-size($h1-font-size);
}
h2 {
@extend %heading;
@include font-size($h2-font-size);
}
h3 {
@extend %heading;
@include font-size($h3-font-size);
}
h4 {
@extend %heading;
@include font-size($h4-font-size);
}
h5 {
@extend %heading;
@include font-size($h5-font-size);
}
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`.
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.
abbr[title] {
text-decoration: underline dotted; // 1
cursor: help; // 2
text-decoration-skip-ink: none; // 3
}
// Address
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
// Lists
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: $dt-font-weight;
}
// 1. Undo browser default
dd {
margin-bottom: .5rem;
margin-left: 0; // 1
}
// Blockquote
blockquote {
margin: 0 0 1rem;
}
// Strong
//
// Add the correct font weight in Chrome, Edge, and Safari
b,
strong {
font-weight: $font-weight-bolder;
}
// Small
//
// Add the correct font size in all browsers
small {
@include font-size($small-font-size);
}
// 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,
sup {
position: relative;
@include font-size($sub-sup-font-size);
line-height: 0;
vertical-align: baseline;
}
sub { bottom: -.25em; }
sup { top: -.5em; }
// Links
a {
color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));
text-decoration: $link-decoration;
&:hover {
--#{$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
a:not([href]):not([class]) {
&,
&:hover {
color: inherit;
text-decoration: none;
}
}
// Code
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
pre {
display: block;
margin-top: 0; // 1
margin-bottom: 1rem; // 2
overflow: auto; // 3
@include font-size($code-font-size);
color: $pre-color;
// Account for some code outputs that place code tags in pre tags
code {
@include font-size(inherit);
color: inherit;
word-break: normal;
}
}
code {
@include font-size($code-font-size);
color: var(--#{$prefix}code-color);
word-wrap: break-word;
// Streamline the style when inside anchors to avoid broken underline and more
a > & {
color: inherit;
}
}
kbd {
padding: $kbd-padding-y $kbd-padding-x;
@include font-size($kbd-font-size);
color: $kbd-color;
background-color: $kbd-bg;
@include border-radius($border-radius-sm);
kbd {
padding: 0;
@include font-size(1em);
font-weight: $nested-kbd-font-weight;
}
}
// Figures
//
// Apply a consistent margin strategy (matches our type styles).
figure {
margin: 0 0 1rem;
}
// Images and content
img,
svg {
vertical-align: middle;
}
// Tables
//
// Prevent double borders
table {
caption-side: bottom;
border-collapse: collapse;
}
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
th {
font-weight: $table-th-font-weight; // 1
text-align: inherit; // 2
text-align: -webkit-match-parent; // 3
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
// Forms
//
// 1. Allow labels to use `margin` for spacing.
label {
display: inline-block; // 1
}
// Remove the default `border-radius` that macOS Chrome adds.
// See https://github.com/twbs/bootstrap/issues/24093
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.
button:focus:not(:focus-visible) {
outline: 0;
}
// 1. Remove the margin in Firefox and Safari
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 {
text-transform: none;
}
// Set the cursor for non-`<button>` buttons
//
// Details at https://github.com/twbs/bootstrap/pull/30562
[role="button"] {
cursor: pointer;
}
select {
// Remove the inheritance of word-wrap in Safari.
// See https://github.com/twbs/bootstrap/issues/24990
word-wrap: normal;
// Undo the opacity change from Chrome
&:disabled {
opacity: 1;
}
}
// 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 {
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.
button,
[type="button"], // 1
[type="reset"],
[type="submit"] {
-webkit-appearance: button; // 2
@if $enable-button-pointers {
&:not(:disabled) {
cursor: pointer; // 3
}
}
}
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
::-moz-focus-inner {
padding: 0;
border-style: none;
}
// 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
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.
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
legend {
float: left; // 1
width: 100%;
padding: 0;
margin-bottom: $legend-margin-bottom;
font-weight: $legend-font-weight;
line-height: inherit;
@include font-size($legend-font-size);
+ * {
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
::-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 {
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.
[type="search"] {
-webkit-appearance: textfield; // 1
outline-offset: -2px; // 2
}
// 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"] {
direction: ltr;
}
*/
// Remove the inner padding in Chrome and Safari on macOS.
::-webkit-search-decoration {
-webkit-appearance: none;
}
// Remove padding around color pickers in webkit browsers
::-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.
::file-selector-button {
font: inherit; // 1
-webkit-appearance: button; // 2
}
// Correct element displays
output {
display: inline-block;
}
// Remove border from iframe
iframe {
border: 0;
}
// Summary
//
// 1. Add the correct display in all browsers
summary {
display: list-item; // 1
cursor: pointer;
}
// Progress
//
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
progress {
vertical-align: baseline;
}
// Hidden attribute
//
// Always hide an element with the `hidden` HTML attribute.
[hidden] {
display: none !important;
}

View File

@ -5,6 +5,24 @@
@use "vendor/rfs" as *; @use "vendor/rfs" as *;
@use "mixins/color-mode" 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;
@layer colors {
:root,
[data-bs-theme="light"] {
@each $color-group-name, $color-group in $all-colors {
@each $color-name, $color-value in $color-group {
--#{$prefix}#{$color-name}: #{$color-value};
}
}
@each $color, $value in $theme-colors {
--#{$prefix}#{$color}: #{$value};
}
}
}
:root, :root,
[data-bs-theme="light"] { [data-bs-theme="light"] {
// Note: Custom variable values only support SassScript inside `#{}`. // Note: Custom variable values only support SassScript inside `#{}`.
@ -13,11 +31,11 @@
// //
// Generate palettes for full colors, grays, and theme colors. // Generate palettes for full colors, grays, and theme colors.
@each $color-group-name, $color-group in $all-colors { // @each $color-group-name, $color-group in $all-colors {
@each $color-name, $color-value in $color-group { // @each $color-name, $color-value in $color-group {
--#{$prefix}#{$color-name}: #{$color-value}; // --#{$prefix}#{$color-name}: #{$color-value};
} // }
} // }
// @each $color, $value in $colors { // @each $color, $value in $colors {
// --#{$prefix}#{$color}: #{$value}; // --#{$prefix}#{$color}: #{$value};
@ -27,9 +45,9 @@
// --#{$prefix}gray-#{$color}: #{$value}; // --#{$prefix}gray-#{$color}: #{$value};
// } // }
@each $color, $value in $theme-colors { // @each $color, $value in $theme-colors {
--#{$prefix}#{$color}: #{$value}; // --#{$prefix}#{$color}: #{$value};
} // }
@each $color, $value in $theme-colors-rgb { @each $color, $value in $theme-colors-rgb {
--#{$prefix}#{$color}-rgb: #{$value}; --#{$prefix}#{$color}-rgb: #{$value};

View File

@ -1,12 +1,13 @@
@use "config" as *; @use "config" as *;
@use "variables" as *; @use "variables" as *;
// @layer components {
// Rotating border //
// // Rotating border
//
.spinner-grow, .spinner-grow,
.spinner-border { .spinner-border {
display: inline-block; display: inline-block;
width: var(--#{$prefix}spinner-width); width: var(--#{$prefix}spinner-width);
height: var(--#{$prefix}spinner-height); height: var(--#{$prefix}spinner-height);
@ -14,15 +15,15 @@
// stylelint-disable-next-line property-disallowed-list // stylelint-disable-next-line property-disallowed-list
border-radius: 50%; border-radius: 50%;
animation: var(--#{$prefix}spinner-animation-speed) linear infinite var(--#{$prefix}spinner-animation-name); animation: var(--#{$prefix}spinner-animation-speed) linear infinite var(--#{$prefix}spinner-animation-name);
} }
// scss-docs-start spinner-border-keyframes // scss-docs-start spinner-border-keyframes
@keyframes spinner-border { @keyframes spinner-border {
to { transform: rotate(360deg) #{"/* rtl:ignore */"}; } 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 // scss-docs-start spinner-border-css-vars
--#{$prefix}spinner-width: #{$spinner-width}; --#{$prefix}spinner-width: #{$spinner-width};
--#{$prefix}spinner-height: #{$spinner-height}; --#{$prefix}spinner-height: #{$spinner-height};
@ -34,22 +35,22 @@
border: var(--#{$prefix}spinner-border-width) solid currentcolor; border: var(--#{$prefix}spinner-border-width) solid currentcolor;
border-right-color: transparent; border-right-color: transparent;
} }
.spinner-border-sm { .spinner-border-sm {
// scss-docs-start spinner-border-sm-css-vars // scss-docs-start spinner-border-sm-css-vars
--#{$prefix}spinner-width: #{$spinner-width-sm}; --#{$prefix}spinner-width: #{$spinner-width-sm};
--#{$prefix}spinner-height: #{$spinner-height-sm}; --#{$prefix}spinner-height: #{$spinner-height-sm};
--#{$prefix}spinner-border-width: #{$spinner-border-width-sm}; --#{$prefix}spinner-border-width: #{$spinner-border-width-sm};
// scss-docs-end spinner-border-sm-css-vars // scss-docs-end spinner-border-sm-css-vars
} }
// //
// Growing circle // Growing circle
// //
// scss-docs-start spinner-grow-keyframes // scss-docs-start spinner-grow-keyframes
@keyframes spinner-grow { @keyframes spinner-grow {
0% { 0% {
transform: scale(0); transform: scale(0);
} }
@ -57,10 +58,10 @@
opacity: 1; opacity: 1;
transform: none; 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 // scss-docs-start spinner-grow-css-vars
--#{$prefix}spinner-width: #{$spinner-width}; --#{$prefix}spinner-width: #{$spinner-width};
--#{$prefix}spinner-height: #{$spinner-height}; --#{$prefix}spinner-height: #{$spinner-height};
@ -71,18 +72,19 @@
background-color: currentcolor; background-color: currentcolor;
opacity: 0; opacity: 0;
} }
.spinner-grow-sm { .spinner-grow-sm {
--#{$prefix}spinner-width: #{$spinner-width-sm}; --#{$prefix}spinner-width: #{$spinner-width-sm};
--#{$prefix}spinner-height: #{$spinner-height-sm}; --#{$prefix}spinner-height: #{$spinner-height-sm};
} }
@if $enable-reduced-motion { @if $enable-reduced-motion {
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
.spinner-border, .spinner-border,
.spinner-grow { .spinner-grow {
--#{$prefix}spinner-animation-speed: #{$spinner-animation-speed * 2}; --#{$prefix}spinner-animation-speed: #{$spinner-animation-speed * 2};
} }
} }
}
} }

View File

@ -1,203 +0,0 @@
@use "sass:map";
@use "config" as *;
@use "colors" as *;
@use "variables" as *;
@use "functions" as *;
@use "layout/breakpoints" as *;
// scss-docs-start table-variant
@mixin table-variant($state, $background) {
.table-#{$state} {
$color: color-contrast(opaque($body-bg, $background));
$hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
$striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
$active-bg: mix($color, $background, percentage($table-active-bg-factor));
$table-border-color: mix($color, $background, percentage($table-border-factor));
--#{$prefix}table-color: #{$color};
--#{$prefix}table-bg: #{$background};
--#{$prefix}table-border-color: #{$table-border-color};
--#{$prefix}table-striped-bg: #{$striped-bg};
--#{$prefix}table-striped-color: #{color-contrast($striped-bg)};
--#{$prefix}table-active-bg: #{$active-bg};
--#{$prefix}table-active-color: #{color-contrast($active-bg)};
--#{$prefix}table-hover-bg: #{$hover-bg};
--#{$prefix}table-hover-color: #{color-contrast($hover-bg)};
color: var(--#{$prefix}table-color);
border-color: var(--#{$prefix}table-border-color);
}
}
// scss-docs-end table-variant
//
// Basic Bootstrap table
//
.table {
// Reset needed for nesting tables
--#{$prefix}table-color-type: initial;
--#{$prefix}table-bg-type: initial;
--#{$prefix}table-color-state: initial;
--#{$prefix}table-bg-state: initial;
// End of reset
--#{$prefix}table-color: #{$table-color};
--#{$prefix}table-bg: #{$table-bg};
--#{$prefix}table-border-color: #{$table-border-color};
--#{$prefix}table-accent-bg: #{$table-accent-bg};
--#{$prefix}table-striped-color: #{$table-striped-color};
--#{$prefix}table-striped-bg: #{$table-striped-bg};
--#{$prefix}table-active-color: #{$table-active-color};
--#{$prefix}table-active-bg: #{$table-active-bg};
--#{$prefix}table-hover-color: #{$table-hover-color};
--#{$prefix}table-hover-bg: #{$table-hover-bg};
width: 100%;
margin-bottom: $spacer;
vertical-align: $table-cell-vertical-align;
border-color: var(--#{$prefix}table-border-color);
// Target th & td
// We need the child combinator to prevent styles leaking to nested tables which doesn't have a `.table` class.
// We use the universal selectors here to simplify the selector (else we would need 6 different selectors).
// Another advantage is that this generates less code and makes the selector less specific making it easier to override.
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
padding: $table-cell-padding-y $table-cell-padding-x;
// Following the precept of cascades: https://codepen.io/miriamsuzanne/full/vYNgodb
color: var(--#{$prefix}table-color-state, var(--#{$prefix}table-color-type, var(--#{$prefix}table-color)));
background-color: var(--#{$prefix}table-bg);
border-bottom-width: $table-border-width;
box-shadow: inset 0 0 0 9999px var(--#{$prefix}table-bg-state, var(--#{$prefix}table-bg-type, var(--#{$prefix}table-accent-bg)));
}
> tbody {
vertical-align: inherit;
}
> thead {
vertical-align: bottom;
}
}
.table-group-divider {
border-top: calc(#{$table-border-width} * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
}
//
// Change placement of captions with a class
//
.caption-top {
caption-side: top;
}
//
// Condensed table w/ half padding
//
.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
.table-bordered {
> :not(caption) > * {
border-width: $table-border-width 0;
// stylelint-disable-next-line selector-max-universal
> * {
border-width: 0 $table-border-width;
}
}
}
.table-borderless {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
border-bottom-width: 0;
}
> :not(:first-child) {
border-top-width: 0;
}
}
// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
// 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 {
> :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
.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
.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
@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.
@each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-down($breakpoint) {
.table-responsive#{$infix} {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
}
}

View File

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

View File

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

View File

@ -1,112 +0,0 @@
@use "config" as *;
@use "variables" as *;
@use "mixins/lists" as *;
@use "vendor/rfs" as *;
//
// Headings
//
// mdo-do: remove extend
// .h1 {
// @extend h1;
// }
// .h2 {
// @extend h2;
// }
// .h3 {
// @extend h3;
// }
// .h4 {
// @extend h4;
// }
// .h5 {
// @extend h5;
// }
// .h6 {
// @extend h6;
// }
.lead {
@include font-size($lead-font-size);
font-weight: $lead-font-weight;
}
// Type display classes
@each $display, $font-size in $display-font-sizes {
.display-#{$display} {
font-family: $display-font-family;
font-style: $display-font-style;
font-weight: $display-font-weight;
line-height: $display-line-height;
@include font-size($font-size);
}
}
//
// Emphasis
//
.small {
// @extend small;
}
.mark {
// @extend mark;
}
//
// Lists
//
.list-unstyled {
@include list-unstyled();
}
// Inline turns list items into inline-block
.list-inline {
@include list-unstyled();
}
.list-inline-item {
display: inline-block;
&:not(:last-child) {
margin-right: $list-inline-padding;
}
}
//
// Misc
//
// Builds on `abbr`
.initialism {
@include font-size($initialism-font-size);
text-transform: uppercase;
}
// Blockquotes
.blockquote {
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-font-size);
> :last-child {
margin-bottom: 0;
}
}
.blockquote-footer {
margin-top: -$blockquote-margin-y;
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-footer-font-size);
color: $blockquote-footer-color;
&::before {
content: "\2014\00A0"; // em dash, nbsp
}
}

View File

@ -5,8 +5,6 @@
@use "functions" as *; @use "functions" as *;
@use "maps" as *; @use "maps" as *;
// Utilities
$utilities: () !default; $utilities: () !default;
// stylelint-disable-next-line scss/dollar-variable-default // stylelint-disable-next-line scss/dollar-variable-default
$utilities: map.merge( $utilities: map.merge(

70
scss/bootstrap.scss vendored
View File

@ -1,52 +1,46 @@
// @import "mixins/banner"; /*!
// @include bsBanner(""); * Bootstrap v6.0.0-dev (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
// scss-docs-start import-stack // scss-docs-start import-stack
// Configuration // Global CSS variables, layer definitions, and configuration
// @use "config" as *;
// @import "functions";
// @import "colors";
// @import "variables";
// @import "variables-dark";
@use "maps";
@use "mixins";
// @use "utilities";
// Layout & components
@use "root"; @use "root";
@use "reboot";
@use "type"; // Reboot & Content
@use "images"; @use "content";
// @import "containers";
// @import "grid"; // Layout
@use "layout"; @use "layout";
@use "tables";
// Forms
@use "forms"; @use "forms";
// Components
@use "accordion";
@use "alert";
@use "badge";
@use "breadcrumb";
@use "buttons"; @use "buttons";
@use "transitions";
@use "dropdown";
@use "button-group"; @use "button-group";
@use "card";
@use "carousel";
@use "close";
@use "dropdown";
@use "list-group";
@use "modal";
@use "nav"; @use "nav";
@use "navbar"; @use "navbar";
@use "card";
@use "accordion";
@use "breadcrumb";
@use "pagination";
@use "badge";
@use "alert";
@use "progress";
@use "list-group";
@use "close";
@use "toasts";
@use "modal";
@use "tooltip";
@use "popover";
@use "carousel";
@use "spinners";
@use "offcanvas"; @use "offcanvas";
@use "pagination";
@use "placeholders"; @use "placeholders";
@use "popover";
@use "progress";
@use "spinners";
@use "toasts";
@use "tooltip";
@use "transitions";
// Helpers // Helpers
@use "helpers"; @use "helpers";

51
scss/content/_images.scss Normal file
View File

@ -0,0 +1,51 @@
@use "../config" as *;
@use "../variables" as *;
@use "../vendor/rfs" as *;
@use "../mixins/image" as *;
@use "../mixins/border-radius" as *;
@use "../mixins/box-shadow" as *;
@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 {
padding: $thumbnail-padding;
background-color: $thumbnail-bg;
border: $thumbnail-border-width solid $thumbnail-border-color;
@include border-radius($thumbnail-border-radius);
@include box-shadow($thumbnail-box-shadow);
// Keep them at most 100% wide
@include img-fluid();
}
//
// Figures
//
.figure {
// Ensures the caption's text aligns with the image.
display: inline-block;
}
.figure-img {
margin-bottom: $spacer * .5;
line-height: 1;
}
.figure-caption {
@include font-size($figure-caption-font-size);
color: $figure-caption-color;
}
}

618
scss/content/_reboot.scss Normal file
View File

@ -0,0 +1,618 @@
@use "../config" as *;
@use "../colors" as *;
@use "../variables" as *;
@use "../vendor/rfs" as *;
@use "../mixins/border-radius" as *;
// stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
@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`.
*,
*::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 {
@if $font-size-root != null {
@include font-size(var(--#{$prefix}root-font-size));
}
@if $enable-smooth-scroll {
@media (prefers-reduced-motion: no-preference) {
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.
// 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));
font-weight: var(--#{$prefix}body-font-weight);
line-height: var(--#{$prefix}body-line-height);
color: var(--#{$prefix}body-color);
text-align: var(--#{$prefix}body-text-align);
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
// Content grouping
//
// 1. Reset Firefox's gray color
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.
%heading {
margin-top: 0; // 1
margin-bottom: $headings-margin-bottom;
font-family: $headings-font-family;
font-style: $headings-font-style;
font-weight: $headings-font-weight;
line-height: $headings-line-height;
color: var(--#{$prefix}heading-color);
}
h1 {
@extend %heading;
@include font-size($h1-font-size);
}
h2 {
@extend %heading;
@include font-size($h2-font-size);
}
h3 {
@extend %heading;
@include font-size($h3-font-size);
}
h4 {
@extend %heading;
@include font-size($h4-font-size);
}
h5 {
@extend %heading;
@include font-size($h5-font-size);
}
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`.
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.
abbr[title] {
text-decoration: underline dotted; // 1
cursor: help; // 2
text-decoration-skip-ink: none; // 3
}
// Address
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
// Lists
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: $dt-font-weight;
}
// 1. Undo browser default
dd {
margin-bottom: .5rem;
margin-left: 0; // 1
}
// Blockquote
blockquote {
margin: 0 0 1rem;
}
// Strong
//
// Add the correct font weight in Chrome, Edge, and Safari
b,
strong {
font-weight: $font-weight-bolder;
}
// Small
//
// Add the correct font size in all browsers
small {
@include font-size($small-font-size);
}
// 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,
sup {
position: relative;
@include font-size($sub-sup-font-size);
line-height: 0;
vertical-align: baseline;
}
sub { bottom: -.25em; }
sup { top: -.5em; }
// Links
a {
color: rgba(var(--#{$prefix}link-color-rgb), var(--#{$prefix}link-opacity, 1));
text-decoration: $link-decoration;
&:hover {
--#{$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
a:not([href]):not([class]) {
&,
&:hover {
color: inherit;
text-decoration: none;
}
}
// Code
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
pre {
display: block;
margin-top: 0; // 1
margin-bottom: 1rem; // 2
overflow: auto; // 3
@include font-size($code-font-size);
color: $pre-color;
// Account for some code outputs that place code tags in pre tags
code {
@include font-size(inherit);
color: inherit;
word-break: normal;
}
}
code {
@include font-size($code-font-size);
color: var(--#{$prefix}code-color);
word-wrap: break-word;
// Streamline the style when inside anchors to avoid broken underline and more
a > & {
color: inherit;
}
}
kbd {
padding: $kbd-padding-y $kbd-padding-x;
@include font-size($kbd-font-size);
color: $kbd-color;
background-color: $kbd-bg;
@include border-radius($border-radius-sm);
kbd {
padding: 0;
@include font-size(1em);
font-weight: $nested-kbd-font-weight;
}
}
// Figures
//
// Apply a consistent margin strategy (matches our type styles).
figure {
margin: 0 0 1rem;
}
// Images and content
img,
svg {
vertical-align: middle;
}
// Tables
//
// Prevent double borders
table {
caption-side: bottom;
border-collapse: collapse;
}
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
th {
font-weight: $table-th-font-weight; // 1
text-align: inherit; // 2
text-align: -webkit-match-parent; // 3
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
// Forms
//
// 1. Allow labels to use `margin` for spacing.
label {
display: inline-block; // 1
}
// Remove the default `border-radius` that macOS Chrome adds.
// See https://github.com/twbs/bootstrap/issues/24093
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.
button:focus:not(:focus-visible) {
outline: 0;
}
// 1. Remove the margin in Firefox and Safari
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 {
text-transform: none;
}
// Set the cursor for non-`<button>` buttons
//
// Details at https://github.com/twbs/bootstrap/pull/30562
[role="button"] {
cursor: pointer;
}
select {
// Remove the inheritance of word-wrap in Safari.
// See https://github.com/twbs/bootstrap/issues/24990
word-wrap: normal;
// Undo the opacity change from Chrome
&:disabled {
opacity: 1;
}
}
// 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 {
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.
button,
[type="button"], // 1
[type="reset"],
[type="submit"] {
-webkit-appearance: button; // 2
@if $enable-button-pointers {
&:not(:disabled) {
cursor: pointer; // 3
}
}
}
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
::-moz-focus-inner {
padding: 0;
border-style: none;
}
// 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
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.
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
legend {
float: left; // 1
width: 100%;
padding: 0;
margin-bottom: $legend-margin-bottom;
font-weight: $legend-font-weight;
line-height: inherit;
@include font-size($legend-font-size);
+ * {
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
::-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 {
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.
[type="search"] {
-webkit-appearance: textfield; // 1
outline-offset: -2px; // 2
}
// 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"] {
direction: ltr;
}
*/
// Remove the inner padding in Chrome and Safari on macOS.
::-webkit-search-decoration {
-webkit-appearance: none;
}
// Remove padding around color pickers in webkit browsers
::-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.
::file-selector-button {
font: inherit; // 1
-webkit-appearance: button; // 2
}
// Correct element displays
output {
display: inline-block;
}
// Remove border from iframe
iframe {
border: 0;
}
// Summary
//
// 1. Add the correct display in all browsers
summary {
display: list-item; // 1
cursor: pointer;
}
// Progress
//
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
progress {
vertical-align: baseline;
}
// Hidden attribute
//
// Always hide an element with the `hidden` HTML attribute.
[hidden] {
display: none !important;
}
}

205
scss/content/_tables.scss Normal file
View File

@ -0,0 +1,205 @@
@use "sass:map";
@use "../config" as *;
@use "../colors" as *;
@use "../variables" as *;
@use "../functions" as *;
@use "../layout/breakpoints" as *;
@layer content {
// scss-docs-start table-variant
@mixin table-variant($state, $background) {
.table-#{$state} {
$color: color-contrast(opaque($body-bg, $background));
$hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
$striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
$active-bg: mix($color, $background, percentage($table-active-bg-factor));
$table-border-color: mix($color, $background, percentage($table-border-factor));
--#{$prefix}table-color: #{$color};
--#{$prefix}table-bg: #{$background};
--#{$prefix}table-border-color: #{$table-border-color};
--#{$prefix}table-striped-bg: #{$striped-bg};
--#{$prefix}table-striped-color: #{color-contrast($striped-bg)};
--#{$prefix}table-active-bg: #{$active-bg};
--#{$prefix}table-active-color: #{color-contrast($active-bg)};
--#{$prefix}table-hover-bg: #{$hover-bg};
--#{$prefix}table-hover-color: #{color-contrast($hover-bg)};
color: var(--#{$prefix}table-color);
border-color: var(--#{$prefix}table-border-color);
}
}
// scss-docs-end table-variant
//
// Basic Bootstrap table
//
.table {
// Reset needed for nesting tables
--#{$prefix}table-color-type: initial;
--#{$prefix}table-bg-type: initial;
--#{$prefix}table-color-state: initial;
--#{$prefix}table-bg-state: initial;
// End of reset
--#{$prefix}table-color: #{$table-color};
--#{$prefix}table-bg: #{$table-bg};
--#{$prefix}table-border-color: #{$table-border-color};
--#{$prefix}table-accent-bg: #{$table-accent-bg};
--#{$prefix}table-striped-color: #{$table-striped-color};
--#{$prefix}table-striped-bg: #{$table-striped-bg};
--#{$prefix}table-active-color: #{$table-active-color};
--#{$prefix}table-active-bg: #{$table-active-bg};
--#{$prefix}table-hover-color: #{$table-hover-color};
--#{$prefix}table-hover-bg: #{$table-hover-bg};
width: 100%;
margin-bottom: $spacer;
vertical-align: $table-cell-vertical-align;
border-color: var(--#{$prefix}table-border-color);
// Target th & td
// We need the child combinator to prevent styles leaking to nested tables which doesn't have a `.table` class.
// We use the universal selectors here to simplify the selector (else we would need 6 different selectors).
// Another advantage is that this generates less code and makes the selector less specific making it easier to override.
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
padding: $table-cell-padding-y $table-cell-padding-x;
// Following the precept of cascades: https://codepen.io/miriamsuzanne/full/vYNgodb
color: var(--#{$prefix}table-color-state, var(--#{$prefix}table-color-type, var(--#{$prefix}table-color)));
background-color: var(--#{$prefix}table-bg);
border-bottom-width: $table-border-width;
box-shadow: inset 0 0 0 9999px var(--#{$prefix}table-bg-state, var(--#{$prefix}table-bg-type, var(--#{$prefix}table-accent-bg)));
}
> tbody {
vertical-align: inherit;
}
> thead {
vertical-align: bottom;
}
}
.table-group-divider {
border-top: calc(#{$table-border-width} * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
}
//
// Change placement of captions with a class
//
.caption-top {
caption-side: top;
}
//
// Condensed table w/ half padding
//
.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
.table-bordered {
> :not(caption) > * {
border-width: $table-border-width 0;
// stylelint-disable-next-line selector-max-universal
> * {
border-width: 0 $table-border-width;
}
}
}
.table-borderless {
// stylelint-disable-next-line selector-max-universal
> :not(caption) > * > * {
border-bottom-width: 0;
}
> :not(:first-child) {
border-top-width: 0;
}
}
// Zebra-striping
//
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
// 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 {
> :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
.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
.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
@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.
@each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@include media-breakpoint-down($breakpoint) {
.table-responsive#{$infix} {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
}
}
}

114
scss/content/_type.scss Normal file
View File

@ -0,0 +1,114 @@
@use "../config" as *;
@use "../variables" as *;
@use "../mixins/lists" as *;
@use "../vendor/rfs" as *;
@layer content {
//
// Headings
//
// mdo-do: remove extend
// .h1 {
// @extend h1;
// }
// .h2 {
// @extend h2;
// }
// .h3 {
// @extend h3;
// }
// .h4 {
// @extend h4;
// }
// .h5 {
// @extend h5;
// }
// .h6 {
// @extend h6;
// }
.lead {
@include font-size($lead-font-size);
font-weight: $lead-font-weight;
}
// Type display classes
@each $display, $font-size in $display-font-sizes {
.display-#{$display} {
font-family: $display-font-family;
font-style: $display-font-style;
font-weight: $display-font-weight;
line-height: $display-line-height;
@include font-size($font-size);
}
}
//
// Emphasis
//
.small {
// @extend small;
}
.mark {
// @extend mark;
}
//
// Lists
//
.list-unstyled {
@include list-unstyled();
}
// Inline turns list items into inline-block
.list-inline {
@include list-unstyled();
}
.list-inline-item {
display: inline-block;
&:not(:last-child) {
margin-right: $list-inline-padding;
}
}
//
// Misc
//
// Builds on `abbr`
.initialism {
@include font-size($initialism-font-size);
text-transform: uppercase;
}
// Blockquotes
.blockquote {
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-font-size);
> :last-child {
margin-bottom: 0;
}
}
.blockquote-footer {
margin-top: -$blockquote-margin-y;
margin-bottom: $blockquote-margin-y;
@include font-size($blockquote-footer-font-size);
color: $blockquote-footer-color;
&::before {
content: "\2014\00A0"; // em dash, nbsp
}
}
}

4
scss/content/index.scss Normal file
View File

@ -0,0 +1,4 @@
@forward "reboot";
@forward "type";
@forward "tables";
@forward "images";

View File

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

View File

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

View File

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

View File

@ -11,7 +11,8 @@
// elements cannot be mixed. As such, there are no shared styles for focus or // elements cannot be mixed. As such, there are no shared styles for focus or
// active states on prefixed selectors. // active states on prefixed selectors.
.form-range { @layer forms {
.form-range {
width: 100%; width: 100%;
height: add($form-range-thumb-height, $form-range-thumb-focus-box-shadow-width * 2); height: add($form-range-thumb-height, $form-range-thumb-focus-box-shadow-width * 2);
padding: 0; // Need to reset padding padding: 0; // Need to reset padding
@ -95,4 +96,5 @@
background-color: $form-range-thumb-disabled-bg; 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 // Replaces the browser default select with a custom one, mostly pulled from
// https://primer.github.io/. // https://primer.github.io/.
.form-select { @layer forms {
.form-select {
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator)}; --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator)};
display: block; display: block;
@ -61,28 +62,29 @@
color: transparent; color: transparent;
text-shadow: 0 0 0 $form-select-color; text-shadow: 0 0 0 $form-select-color;
} }
} }
.form-select-sm { .form-select-sm {
padding-top: $form-select-padding-y-sm; padding-top: $form-select-padding-y-sm;
padding-bottom: $form-select-padding-y-sm; padding-bottom: $form-select-padding-y-sm;
padding-left: $form-select-padding-x-sm; padding-left: $form-select-padding-x-sm;
@include font-size($form-select-font-size-sm); @include font-size($form-select-font-size-sm);
@include border-radius($form-select-border-radius-sm); @include border-radius($form-select-border-radius-sm);
} }
.form-select-lg { .form-select-lg {
padding-top: $form-select-padding-y-lg; padding-top: $form-select-padding-y-lg;
padding-bottom: $form-select-padding-y-lg; padding-bottom: $form-select-padding-y-lg;
padding-left: $form-select-padding-x-lg; padding-left: $form-select-padding-x-lg;
@include font-size($form-select-font-size-lg); @include font-size($form-select-font-size-lg);
@include border-radius($form-select-border-radius-lg); @include border-radius($form-select-border-radius-lg);
} }
@if $enable-dark-mode { @if $enable-dark-mode {
@include color-mode(dark) { @include color-mode(dark) {
.form-select { .form-select {
--#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)}; --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
} }
} }
}
} }

View File

@ -1,13 +1,16 @@
@use "../variables" as *; @use "../variables" as *;
@use "../vendor/rfs" as *; @use "../vendor/rfs" as *;
// //
// Form text // Form text
// //
.form-text { @layer forms {
.form-text {
margin-top: $form-text-margin-top; margin-top: $form-text-margin-top;
@include font-size($form-text-font-size); @include font-size($form-text-font-size);
font-style: $form-text-font-style; font-style: $form-text-font-style;
font-weight: $form-text-font-weight; font-weight: $form-text-font-weight;
color: $form-text-color; color: $form-text-color;
}
} }

View File

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

View File

@ -1,20 +1,22 @@
@use "../variables" as *; @use "../variables" as *;
@use "../vendor/rfs" as *; @use "../vendor/rfs" as *;
// //
// Labels // Labels
// //
.form-label { @layer forms {
.form-label {
margin-bottom: $form-label-margin-bottom; margin-bottom: $form-label-margin-bottom;
@include font-size($form-label-font-size); @include font-size($form-label-font-size);
font-style: $form-label-font-style; font-style: $form-label-font-style;
font-weight: $form-label-font-weight; font-weight: $form-label-font-weight;
color: $form-label-color; color: $form-label-color;
} }
// For use with horizontal and inline forms, when you need the label (or legend) // For use with horizontal and inline forms, when you need the label (or legend)
// text to align with the form controls. // text to align with the form controls.
.col-form-label { .col-form-label {
padding-top: add($input-padding-y, $input-border-width); padding-top: add($input-padding-y, $input-border-width);
padding-bottom: add($input-padding-y, $input-border-width); padding-bottom: add($input-padding-y, $input-border-width);
margin-bottom: 0; // Override the `<legend>` default margin-bottom: 0; // Override the `<legend>` default
@ -23,16 +25,17 @@
font-weight: $form-label-font-weight; font-weight: $form-label-font-weight;
line-height: $input-line-height; line-height: $input-line-height;
color: $form-label-color; color: $form-label-color;
} }
.col-form-label-lg { .col-form-label-lg {
padding-top: add($input-padding-y-lg, $input-border-width); padding-top: add($input-padding-y-lg, $input-border-width);
padding-bottom: 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); @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-top: add($input-padding-y-sm, $input-border-width);
padding-bottom: 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); @include font-size($input-font-size-sm);
}
} }

View File

@ -14,8 +14,9 @@
// This mixin uses an `if()` technique to be compatible with Dart Sass // This mixin uses an `if()` technique to be compatible with Dart Sass
// See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details // See https://github.com/sass/sass/issues/1873#issuecomment-152293725 for more details
// scss-docs-start form-validation-mixins @layer forms {
@mixin form-validation-state-selector($state) { // scss-docs-start form-validation-mixins
@mixin form-validation-state-selector($state) {
@if ($state == "valid" or $state == "invalid") { @if ($state == "valid" or $state == "invalid") {
.was-validated #{if(&, "&", "")}:#{$state}, .was-validated #{if(&, "&", "")}:#{$state},
#{if(&, "&", "")}.is-#{$state} { #{if(&, "&", "")}.is-#{$state} {
@ -26,9 +27,9 @@
@content; @content;
} }
} }
} }
@mixin form-validation-state( @mixin form-validation-state(
$state, $state,
$color, $color,
$icon, $icon,
@ -36,7 +37,7 @@
$tooltip-bg-color: rgba($color, $form-feedback-tooltip-opacity), $tooltip-bg-color: rgba($color, $form-feedback-tooltip-opacity),
$focus-box-shadow: 0 0 $input-btn-focus-blur $input-focus-width rgba($color, $input-btn-focus-color-opacity), $focus-box-shadow: 0 0 $input-btn-focus-blur $input-focus-width rgba($color, $input-btn-focus-color-opacity),
$border-color: $color $border-color: $color
) { ) {
.#{$state}-feedback { .#{$state}-feedback {
display: none; display: none;
width: 100%; width: 100%;
@ -172,12 +173,13 @@
} }
} }
} }
} }
// scss-docs-end form-validation-mixins // scss-docs-end form-validation-mixins
// scss-docs-start form-validation-states-loop // scss-docs-start form-validation-states-loop
@each $state, $data in $form-validation-states { @each $state, $data in $form-validation-states {
@include form-validation-state($state, $data...); @include form-validation-state($state, $data...);
}
// scss-docs-end form-validation-states-loop
} }
// scss-docs-end form-validation-states-loop

View File

@ -1,5 +1,7 @@
@use "../mixins/clearfix" as *; @use "../mixins/clearfix" as *;
.clearfix { @layer helpers {
.clearfix {
@include clearfix(); @include clearfix();
}
} }

View File

@ -3,9 +3,11 @@
@use "../variables" as *; @use "../variables" as *;
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251 // 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 {
@each $color, $value in $theme-colors {
.text-bg-#{$color} { .text-bg-#{$color} {
color: color-contrast($value) if($enable-important-utilities, !important, null); 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); background-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}bg-opacity, 1)) if($enable-important-utilities, !important, null);
} }
}
} }

View File

@ -3,7 +3,8 @@
@use "../variables" as *; @use "../variables" as *;
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251 // 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 {
@each $color, $value in $theme-colors {
.link-#{$color} { .link-#{$color} {
color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null); color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
text-decoration-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
@ -17,10 +18,10 @@
} }
} }
} }
} }
// One-off special link helper as a bridge until v6 // One-off special link helper as a bridge until v6
.link-body-emphasis { .link-body-emphasis {
color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null); color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, 1)) if($enable-important-utilities, !important, null);
text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, 1)) if($enable-important-utilities, !important, null);
@ -31,4 +32,5 @@
text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, .75)) if($enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, .75)) if($enable-important-utilities, !important, null);
} }
} }
}
} }

View File

@ -1,7 +1,9 @@
@use "../config" as *; @use "../config" as *;
.focus-ring:focus { @layer helpers {
.focus-ring:focus {
outline: 0; 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 // 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); 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

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

View File

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

View File

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

View File

@ -4,7 +4,8 @@
// Stretched link // Stretched link
// //
.stretched-link { @layer helpers {
.stretched-link {
&::#{$stretched-link-pseudo-element} { &::#{$stretched-link-pseudo-element} {
position: absolute; position: absolute;
top: 0; top: 0;
@ -14,4 +15,5 @@
z-index: $stretched-link-z-index; z-index: $stretched-link-z-index;
content: ""; content: "";
} }
}
} }

View File

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

View File

@ -4,7 +4,9 @@
// Visually hidden // Visually hidden
// //
.visually-hidden, @layer helpers {
.visually-hidden-focusable:not(:focus):not(:focus-within) { .visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
@include visually-hidden(); @include visually-hidden();
}
} }

View File

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

View File

@ -1,11 +1,11 @@
@import "clearfix"; @forward "clearfix";
@import "color-bg"; @forward "color-bg";
@import "colored-links"; @forward "colored-links";
@import "focus-ring"; @forward "focus-ring";
@import "icon-link"; @forward "icon-link";
@import "position"; @forward "position";
@import "stacks"; @forward "stacks";
@import "visually-hidden"; @forward "visually-hidden";
@import "stretched-link"; @forward "stretched-link";
@import "text-truncation"; @forward "text-truncation";
@import "vr"; @forward "vr";

View File

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

View File

@ -6,8 +6,9 @@
@use "../mixins/utilities" as *; @use "../mixins/utilities" as *;
@use "../utilities" as *; @use "../utilities" as *;
// Loop over each breakpoint @layer utilities {
@each $breakpoint in map.keys($grid-breakpoints) { // Loop over each breakpoint
@each $breakpoint in map.keys($grid-breakpoints) {
// Generate media query if needed // Generate media query if needed
@include media-breakpoint-up($breakpoint) { @include media-breakpoint-up($breakpoint) {
@ -22,10 +23,10 @@
} }
} }
} }
} }
// RFS rescaling // RFS rescaling
@media (min-width: $rfs-mq-value) { @media (min-width: $rfs-mq-value) {
@each $breakpoint in map.keys($grid-breakpoints) { @each $breakpoint in map.keys($grid-breakpoints) {
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
@ -40,11 +41,11 @@
} }
} }
} }
} }
// Print utilities // Print utilities
@media print { @media print {
@each $key, $utility in $utilities { @each $key, $utility in $utilities {
// The utility can be disabled with `false`, thus check if the utility is a map first // The utility can be disabled with `false`, thus check if the utility is a map first
// Then check if the utility needs print styles // Then check if the utility needs print styles
@ -52,4 +53,5 @@
@include generate-utility($utility, "-print"); @include generate-utility($utility, "-print");
} }
} }
}
} }