Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/src/assets/examples/sign-in/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const body_class = 'd-flex align-items-center py-4 bg-body-tertiary'

<main class="form-signin w-100 m-auto">
<form>
<img class="mb-4" src={getVersionedDocsPath('/assets/brand/bootstrap-logo.svg')} alt="" width="72" height="57">
<img class="mb-4" src={getVersionedDocsPath('/assets/brand/bootstrap-logo.svg')} alt="Bootstrap" width="72" height="57">
Comment thread
coliff marked this conversation as resolved.
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>

<div class="form-floating">
Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/components/dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To make a dialog dark, add `data-bs-theme="dark"` to the `<dialog>` element.

When `backdrop` is set to `static`, the dialog will not close when clicking outside of it. Click the button below to try it.

<Example code={`<button type="button" class="btn-solid theme-primary"data-bs-toggle="dialog" data-bs-target="#staticBackdropDialog" data-bs-backdrop="static"><!-- [!code highlight] -->
<Example code={`<button type="button" class="btn-solid theme-primary" data-bs-toggle="dialog" data-bs-target="#staticBackdropDialog" data-bs-backdrop="static"><!-- [!code highlight] -->
Open static backdrop dialog
</button>

Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/components/navbar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Here’s a navbar that includes most supported sub-components and a responsive r

Here’s what you need to know before getting started with the navbar:

- Navbars require a wrapping `.navbar` with `.navbar-expand-{breakpoint}` for responsive collapsing and [color scheme](#color-schemes) classes.
- Navbars require a wrapping `.navbar` with `.{breakpoint}:navbar-expand` (e.g. `.md:navbar-expand`) for responsive collapsing and [color scheme](#color-schemes) classes.
- Navbars and their contents are fluid by default. Change the [container](#containers) to limit their horizontal width in different ways.
- Use our [margin]([[docsref:/utilities/margin]]), [padding]([[docsref:/utilities/padding]]), and [flex]([[docsref:/utilities/flex]]) utility classes for controlling spacing and alignment within navbars.
- Navbars are responsive by default using our **drawer component**. On mobile, navigation links slide in from the side as a drawer.
Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/forms/layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ More complex layouts can also be created with the grid system.

## Horizontal form

Create horizontal forms with the grid by adding the `.row` class to form groups and using the `.col-*-*` classes to specify the width of your labels and controls. Be sure to add `.col-form-label` to your `<label>`s as well so they’re vertically centered with their associated form controls.
Create horizontal forms with the grid by adding the `.row` class to form groups and using `.{breakpoint}:col-*` classes (e.g. `.sm:col-2`) to specify the width of your labels and controls. Be sure to add `.col-form-label` to your `<label>`s as well so they’re vertically centered with their associated form controls.

At times, you maybe need to use margin or padding utilities to create that perfect alignment you need. For example, we’ve removed the `padding-top` on our stacked radio inputs label to better align the text baseline.

Expand Down
6 changes: 3 additions & 3 deletions site/src/content/docs/getting-started/approach.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Sass is used for the following:
- Manage repetitive snippets of code with mixins and functions.
- Toggle global options like `$enable-smooth-scroll`, `$enable-reduced-motion`, etc.
- Configure and generate component variants (theme colors, sizes, etc) through Sass maps, loops, and more.
- Bulk-generate CSS variables for all every tint and shade of our colors.
- Bulk-generate CSS variables for every tint and shade of our colors.
- Manage component token lists (e.g., `$alert-tokens`) and apply them to specific classes.
- Power the utilities API to customize and generate utility classes.

Expand Down Expand Up @@ -197,9 +197,9 @@ We use range media queries (`width >= 768px`, for example) to apply styles at a

### Classes

Aside from [Reboot]([[docsref:content/reboot]]), we strive to use only classes as selectors. Where we can, we avoid type selectors and extraneous parent selectors for greater flexibility.
Aside from [Reboot]([[docsref:/content/reboot]]), we strive to use only classes as selectors. Where we can, we avoid type selectors and extraneous parent selectors for greater flexibility.

Components are typically built with a base class for shared property-value pairs. For example, `.btn` and `.btn-primary`. We use `.btn` for all the common styles like `display`, `padding`, and `border-width`. We then use modifiers like `.btn-solid` to add more styles.
Components are typically built with a base class for shared property-value pairs. For example, `.btn`, `.btn-solid`, and `.theme-primary`. We use `.btn` for all the common styles like `display`, `padding`, and `border-width`. We then use variant and theme modifiers like `.btn-solid.theme-primary` to add more styles.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph probably needs an update because buttons now don't need a base class for shared property-value pairs so the first sentence in the diff above is not correct for buttons.


This reduces complexity, streamlines code, and makes for more scalable systems.

Expand Down
3 changes: 1 addition & 2 deletions site/src/content/docs/getting-started/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ toc: true

Curious which components explicitly require our JavaScript and Floating UI or Vanilla Calendar Pro?

- Accordions for extending our Collapse plugin
- Alerts for dismissing
- Buttons for toggling states and checkbox/radio functionality
- Carousel for all slide behaviors, controls, and indicators
- Collapse for toggling visibility of content
- Datepicker for date selection (also requires [Vanilla Calendar Pro](https://vanilla-calendar.pro/))
- [Dialog]([[docsref:/components/dialog]]) for displaying, positioning, and scroll behavior
- Menus for displaying and positioning (also requires [Floating UI](https://floating-ui.com/))
- Modals for displaying, positioning, and scroll behavior
- Navbar for extending our Collapse and Drawer plugins to implement responsive behaviors
- [Nav]([[docsref:/components/nav]]) for navigation markup and styles; [Tab]([[docsref:/components/tab]]) plugin for toggling tab panes
- Drawers for displaying, positioning, and scroll behavior
Expand Down
6 changes: 3 additions & 3 deletions site/src/content/docs/guides/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ Bootstrap 6 is a major release with many breaking changes to modernize our codeb
- Removed `_variables.scss`, consolidating all variables into `_config.scss`
- Added `_theme.scss` where we setup all our global theming for how colors are applied
- **Updated lg, xl, and 2xl breakpoints and containers.**
- Increased the `lg` breakpoint from 992px to 1024px; it’s container remains the same at 960px.
- Increased the `xl` breakpoint from 1200px to 1280px, and it’s container from 1140px to 1200px.
- Increased the `lg` breakpoint from 992px to 1024px; its container remains the same at 960px.
- Increased the `xl` breakpoint from 1200px to 1280px, and its container from 1140px to 1200px.
- Renamed `xxl` to `2xl` for better scaling with additional custom breakpoints
- Increased the `2xl` breakpoint from 1400px to 1536px, and it’s container from 1320px to 1440px.
- Increased the `2xl` breakpoint from 1400px to 1536px, and its container from 1320px to 1440px.
- **Adopted modern CSS color functions.** All Sass color variables now use `oklch()` notation (e.g., `$blue: oklch(60% 0.24 240)`) and tint/shade scales are generated with `color-mix(in lab, ...)` in the compiled CSS. The v5 `$*-rgb` CSS custom properties and `rgba()` patterns have been removed. This requires browser support for `color-mix()` and `oklch()`.
- **New theme token system with `.theme-*` classes.** Per-component color variant classes (like `.alert-primary`, `.badge.bg-primary`, `.btn-primary`) are replaced by a composable `.theme-{name}` pattern. Adding `.theme-primary` to a component sets `--theme-bg`, `--theme-fg`, `--theme-border`, `--theme-contrast`, and other semantic CSS custom properties that the component reads. This applies across buttons, badges, alerts, cards, accordions, and more.
- **Responsive and state classes now use a prefix instead of an infix or suffix.** Class names follow the Tailwind-style `prefix:class` pattern (e.g., `md:d-none` instead of `d-md-none`, `hover:opacity-50` instead of `opacity-50-hover`). In HTML, use the unescaped colon: `class="md:d-none"`. This applies to utilities, grid, pseudo-state variants, and all responsive components.
Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/helpers/stretched-link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Multiple links and tap targets are not recommended with stretched links. However
Most custom components do not have `position: relative` by default, so we need to add the `.position-relative` here to prevent the link from stretching outside the parent element.

<Example code={`<div class="d-flex position-relative">
<Placeholder width="144" height="144" class="flex-shrink-0 me-3" text={false} title="Generic placeholder image22222" />
<Placeholder width="144" height="144" class="flex-shrink-0 me-3" text={false} title="Generic placeholder image" />
<div>
<h5 class="mt-0">Custom component with stretched link</h5>
<p>This is some placeholder content for the custom component. It is intended to mimic what some real-world content would look like, and we’re using it here to give the component a bit of body and size.</p>
Expand Down
8 changes: 4 additions & 4 deletions site/src/content/docs/utilities/background.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ For example, `.bg-primary` sets the `--bs-bg` variable to `var(--bs-primary-bg)`
This approach allows us to also easily support translucency with our `.bg-{opacity}` utilities as we can use `color-mix()` with the CSS variable to generate the appropriate color. See the [opacity section](#opacity) for more details.

<Example code={[
...getData('theme-colors').map((themeColor) => `<div class="p-3 mb-2 bg-${themeColor.name} color-on-${themeColor.name}">.bg-${themeColor.name}</div>
<div class="p-3 mb-2 bg-muted-${themeColor.name} color-${themeColor.name}">.bg-muted-${themeColor.name}</div>
<div class="p-3 mb-2 bg-subtle-${themeColor.name} color-${themeColor.name}">.bg-subtle-${themeColor.name}</div>`),
...getData('theme-colors').map((themeColor) => `<div class="p-3 mb-2 bg-${themeColor.name} fg-contrast-${themeColor.name}">.bg-${themeColor.name}</div>
<div class="p-3 mb-2 bg-muted-${themeColor.name} fg-${themeColor.name}">.bg-muted-${themeColor.name}</div>
<div class="p-3 mb-2 bg-subtle-${themeColor.name} fg-${themeColor.name}">.bg-subtle-${themeColor.name}</div>`),
`<div class="p-3 mb-2 bg-body fg-body">.bg-body</div>
<div class="p-3 mb-2 bg-1">.bg-1</div>
<div class="p-3 mb-2 bg-2">.bg-2</div>
Expand All @@ -52,7 +52,7 @@ Do you need a gradient in your custom CSS? Just add `background-image: var(--bs-

<Example class="d-flex flex-column gap-2" code={[
...getData('theme-colors').map((themeColor) => `<div class="p-3 bg-${themeColor.name} bg-gradient fg-contrast-${themeColor.name}">.bg-${themeColor.name}.bg-gradient</div>`),
`<div class="p-3 bg-black bg-gradient fg-contrast">.bg-black.bg-gradient</div>`
`<div class="p-3 bg-black bg-gradient fg-white">.bg-black.bg-gradient</div>`
]} />

## Opacity
Expand Down
27 changes: 15 additions & 12 deletions site/src/content/docs/utilities/margin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getData } from '@libs/data'

## Overview

Use margin utilities to control the outer space around elements. Margin utilities are built from a default Sass map ranging from `.25rem` to `3rem`. Use utilities like `.m-3` and `.m-5` to control the margin on all sides of an element:
Use margin utilities to control the outer space around elements. Margin utilities are built from a default Sass map ranging from `0` to `3rem` (`.m-0` through `.m-9`). Use utilities like `.m-3` and `.m-5` to control the margin on all sides of an element:

<Example class="d-flex align-items-center justify-content-center gap-4 text-center" showMarkup={false} code={`
<div class="bd-pattern-diagonal rounded-3">
Expand Down Expand Up @@ -65,9 +65,13 @@ Where *size* is one of:
- `0` - for classes that eliminate the `margin` by setting it to `0`
- `1` - (by default) for classes that set the `margin` to `$spacer * .25`
- `2` - (by default) for classes that set the `margin` to `$spacer * .5`
- `3` - (by default) for classes that set the `margin` to `$spacer`
- `4` - (by default) for classes that set the `margin` to `$spacer * 1.5`
- `5` - (by default) for classes that set the `margin` to `$spacer * 3`
- `3` - (by default) for classes that set the `margin` to `$spacer * .75`
- `4` - (by default) for classes that set the `margin` to `$spacer`
- `5` - (by default) for classes that set the `margin` to `$spacer * 1.25`
- `6` - (by default) for classes that set the `margin` to `$spacer * 1.5`
- `7` - (by default) for classes that set the `margin` to `$spacer * 2`
- `8` - (by default) for classes that set the `margin` to `$spacer * 2.5`
- `9` - (by default) for classes that set the `margin` to `$spacer * 3`
- `auto` - for classes that set the `margin` to auto

(You can add more sizes by adding entries to the `$spacers` Sass map variable.)
Expand Down Expand Up @@ -168,24 +172,23 @@ Bootstrap includes an `.mx-auto` class for horizontally centering fixed-width bl

## Negative margin

In CSS, `margin` properties can utilize negative values (`padding` cannot). These negative margins are **disabled by default**, but can be enabled in Sass by setting `$enable-negative-margins: true`.
In CSS, `margin` properties can utilize negative values (`padding` cannot). In v6, negative margins are limited to `margin-inline-start` and `margin-inline-end` only, using spacers `-1` (`-0.25rem`) and `-2` (`-0.5rem`):

The syntax is nearly the same as the default, positive margin utilities, but with the addition of `n` before the requested size. Here’s an example class that’s the opposite of `.mt-1`:

```scss
.mt-n1 {
margin-top: -0.25rem !important;
}
```html
<div class="ms--1">.ms--1</div>
<div class="me--2">.me--2</div>
```

The v5 full negative margin utilities across all sides (like `.mt-n1`) have been removed.

## Responsive

All margin utilities are responsive and include all breakpoints.

<ul>
{getData('breakpoints').map((breakpoint) => {
return (
<li><code>.{breakpoint.abbr}m-0</code> through <code>.{breakpoint.abbr}m-5</code> and <code>.{breakpoint.abbr}m-auto</code></li>
<li><code>.{breakpoint.abbr}m-0</code> through <code>.{breakpoint.abbr}m-9</code> and <code>.{breakpoint.abbr}m-auto</code></li>
)
})}
</ul>
Expand Down