Skip to content

Commit 9b722fb

Browse files
committed
Move the browserslist commentary into the docs
The rationale had grown to roughly 50 comment lines, and the approach page embeds this file in full, so all of it rendered there ahead of the queries it was meant to explain. Prose belongs on a page that can format it. Move the parts the docs did not already cover onto the browsers and devices page: why `last 2 major versions` carries our mobile coverage, why `unreleased versions` is worth eight points, how to measure coverage and why not to trust browserslist.dev, which features the floors do and do not give us, and which prefixes the excluded engines would add. Leave behind a pointer to that page and the two rules a person editing the file must not get wrong. Both pages now read the query lines out of the file through `fileMatch` instead of hand-copying them. That is what drifted in the first place: the page still claimed Chrome 130 and Safari 18 after the floors briefly moved to 123 and 17.5. The regex is anchored on the first and last query, so a restructure fails the docs build rather than shipping stale versions. The resolved target list, the derived oxc targets, and the build output are all unchanged.
1 parent f3cdbfc commit 9b722fb

3 files changed

Lines changed: 56 additions & 72 deletions

File tree

.browserslistrc

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,28 @@
11
# https://github.com/browserslist/browserslist#readme
22
#
3-
# Browserslist joins every line below with OR, not AND. The `>=` lines do not
4-
# restrict `last 2 major versions`; they add older versions of each engine on
5-
# top of it. `last 2 major versions` is the line that carries mobile coverage,
6-
# because caniuse tracks Chrome for Android as one unversioned entry.
3+
# Read the docs before you change anything here. The support policy, the reason
4+
# behind each floor, the features these floors do and do not give us, and how to
5+
# measure coverage all live in one place:
6+
# https://getbootstrap.com/docs/6.0/getting-started/browsers-devices/
77
#
8-
# Run `npx browserslist --coverage` for the real coverage figure. It reports
9-
# about 85% today. Do not read the number off browserslist.dev, because that
10-
# site pins an old caniuse-db and reports a different result.
8+
# Two rules for editing this file:
9+
# 1. Never set a floor below `light-dark()`: Chrome 123, Firefox 120,
10+
# Safari 17.5. Lightning CSS lowers `light-dark()` to a custom-property
11+
# polyfill below those versions, and the polyfill breaks `data-bs-theme`.
12+
# 2. Run `npx browserslist --coverage` after any change, then update the
13+
# versions and the coverage figure on the docs page above.
1114

1215
last 2 major versions
1316
not dead
14-
15-
# caniuse gives the newest Safari a null release date, but that version already
16-
# holds most of Safari's usage share. Both range queries and `last N versions`
17-
# skip unreleased versions, so this line is worth about 8 points of coverage.
18-
# It costs nothing, because the version is newer than every floor below.
1917
unreleased versions
2018

21-
# These floors are the platform baseline for the whole v6.x line. We cannot raise
22-
# them in a minor release, so they cap what every future 6.x feature may use.
23-
# Each floor sits on the newest feature we already depend on, not the oldest one
24-
# we could tolerate:
25-
# - `:has()` needs Firefox 121. We use it in forms, button groups and cards.
26-
# - `content-visibility` needs Firefox 125 and Safari 18. The accordion
27-
# transitions it with `allow-discrete`.
28-
# - `<details name>` needs Firefox 130. It drives exclusive accordions.
29-
# - Unprefixed `backdrop-filter` needs Safari and iOS 18. Dialog and Drawer
30-
# blur their `::backdrop`. Below 18, Autoprefixer adds `-webkit-` copies.
31-
# - `text-wrap: balance` needs Chrome 130. We ship it as a utility.
32-
# `light-dark()` sets the hard lower bound (Chrome 123, Firefox 120, Safari 17.5).
33-
# Below it, Lightning CSS lowers `light-dark()` to a custom-property polyfill, and
34-
# that polyfill breaks `data-bs-theme` dark mode. Never go below that bound.
3519
Chrome >= 130
3620
Edge >= 130
3721
Firefox >= 132
3822
iOS >= 18.0
3923
Safari >= 18.0
4024

41-
# What these floors buy us. Every item here is safe in any 6.x release with no
42-
# fallback, no prefix and no polyfill. Reach for these first:
43-
# - Colors: `light-dark()`, `oklch()`, `color()` and `color-mix()`
44-
# - Native CSS nesting, so compiled output can stay nested
45-
# - `@layer`, which our layer order depends on
46-
# - `:has()` and `:focus-visible` for contextual styling
47-
# - Container queries, container query units and `subgrid`
48-
# - `content-visibility`, `transition-behavior: allow-discrete` and
49-
# `@starting-style`, which animate `<details>` and `<dialog>` open and closed
50-
# - Native `<dialog>` with `::backdrop` and unprefixed `backdrop-filter`
51-
# - `<details name>` for exclusive accordions
52-
# - `text-wrap: balance`
53-
# - Range syntax in media queries, such as `@media (width >= 1024px)`
54-
#
55-
# What these floors still do not buy. Do not use these in 6.x without a
56-
# fallback. Re-check with `npx browserslist` before you assume one has landed,
57-
# because Firefox is the blocker in almost every case:
58-
# - Relative color syntax, `rgb(from ...)`: Chrome 131, Firefox 133. This sits
59-
# one version above our Chrome floor, so revisit it first in v7.
60-
# - View transitions: Firefox 144
61-
# - `@scope`: Firefox 146
62-
# - Anchor positioning: Firefox 147, Safari 26. This is the big one. It would
63-
# let Menu, Tooltip, Popover and Combobox drop Floating UI.
64-
# - Style container queries: Firefox 151
65-
# - `text-box-trim`: Firefox 154
66-
# - Scrollbar styling: Safari 26.2
67-
68-
# Autoprefixer adds `-webkit-mask-*` for UC and QQ, and `-moz-column-gap` for
69-
# KaiOS. Those three engines hold under 0.8% of users between them, so we drop
70-
# them rather than ship the prefixes. KaiOS also broke floating labels
71-
# (see https://github.com/postcss/autoprefixer/issues/1533).
7225
not and_uc > 0
7326
not and_qq > 0
7427
not kaios > 0
75-
not op_mini all # proxy browser we don't target; only source of redundant -o-object-fit prefixes
28+
not op_mini all

site/src/content/docs/getting-started/approach.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ For improved cross-browser rendering, we use [Reboot]([[docsref:/content/reboot]
168168

169169
### Browser support
170170

171-
You can find our supported range of browsers and their versions [in our `.browserslistrc` file]([[config:repo]]/blob/v[[config:current_version]]/.browserslistrc). The comments record why each floor sits where it does, and which platform features the floors do and do not give us. For a summary table instead, see [Browsers & devices]([[docsref:/getting-started/browsers-devices]]).
171+
You can find our supported range of browsers and their versions [in our `.browserslistrc` file]([[config:repo]]/blob/v[[config:current_version]]/.browserslistrc). See [Browsers & devices]([[docsref:/getting-started/browsers-devices]]) for the reason behind each version, and for the platform features these floors do and do not give us.
172172

173-
<Code lang="plaintext" filePath=".browserslistrc" />
173+
<Code lang="plaintext" filePath=".browserslistrc" fileMatch="last 2 major versions[\s\S]+not op_mini all" />
174174

175175
If you installed Bootstrap via npm, you can also find this file locally at `node_modules/bootstrap/.browserslistrc`.
176176

site/src/content/docs/getting-started/browsers-devices.mdx

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,7 @@ toc: true
88

99
Bootstrap supports the **latest, stable releases** of all major browsers and platforms, plus a run of older versions of each engine. The exact policy lives in [our `.browserslistrc` file](https://github.com/twbs/bootstrap/blob/v6-dev/.browserslistrc):
1010

11-
```text
12-
last 2 major versions
13-
not dead
14-
unreleased versions
15-
Chrome >= 130
16-
Edge >= 130
17-
Firefox >= 132
18-
iOS >= 18.0
19-
Safari >= 18.0
20-
```
11+
<Code lang="plaintext" filePath=".browserslistrc" fileMatch="last 2 major versions[\s\S]+not op_mini all" />
2112

2213
Browserslist joins these lines with OR, not AND. The `>=` lines do not narrow `last 2 major versions`. They add every version above each floor, which is what sets our real minimums:
2314

@@ -33,6 +24,15 @@ Browserslist joins these lines with OR, not AND. The `>=` lines do not narrow `l
3324

3425
Alternative browsers built on these engines (Chromium-based browsers like Brave, Opera, or Vivaldi, and browsers using WebKit on iOS) are not explicitly tested, but should be fully supported at equivalent engine versions.
3526

27+
### How to read the query list
28+
29+
Two of those lines do more than they look like they do:
30+
31+
- **`last 2 major versions` carries our mobile coverage.** caniuse tracks Chrome for Android as a single unversioned entry rather than one entry per release, so this line, not the `>=` floors, is what picks it up.
32+
- **`unreleased versions` is worth about eight points of coverage, and it costs nothing.** caniuse gives the newest Safari a null release date, yet that version already holds most of Safari’s usage share. Both range queries and `last N versions` skip unreleased versions, so without this line we would exclude the single most-used Safari. It cannot pull in anything old, because an unreleased version is newer than every floor.
33+
34+
To measure coverage yourself, run `npx browserslist --coverage` in a clone of the repository. Do not read the figure off browserslist.dev: that site pins an older copy of caniuse-db and reports a materially different number.
35+
3636
### Why these versions?
3737

3838
Bootstrap’s CSS is written against the modern platform baseline: [`light-dark()`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark) for [color modes]([[docsref:/customize/color-modes]]), `oklch()` and `color-mix()` for the [color system]([[docsref:/customize/color]]), native CSS nesting, container queries, and `:has()`.
@@ -51,7 +51,7 @@ Our floors also have to last. They apply to the whole v6.x line, and we cannot r
5151

5252
`light-dark()` sets the hard lower bound: Chrome 123, Firefox 120, and Safari 17.5. Below it, our build pipeline lowers `light-dark()` to a custom-property polyfill, and that polyfill breaks `data-bs-theme` dark mode. We will not go below that bound in any release.
5353

54-
Together these targets cover about 85% of global browser usage. Run `npx browserslist --coverage` in a clone to check the current figure yourself.
54+
Together these targets cover about 85% of global browser usage.
5555

5656
Unlike previous major versions, Bootstrap 6 does not ship fallbacks, prefixes, or polyfills for browsers below this floor. Pages will not render correctly in unsupported browsers—most visibly, colors depending on `light-dark()` will not resolve.
5757

@@ -72,6 +72,37 @@ The table below lists the platform features v6 relies on and how each behaves at
7272
| Logical properties | Spacing, borders, and [RTL]([[docsref:/customize/rtl]]) support throughout | Fully supported above the floor |
7373
</BsTable>
7474

75+
### Also safe to use
76+
77+
The floors clear more of the platform than the components currently use. All of the following need no fallback, no vendor prefix, and no polyfill in any 6.x release, so reach for them first when you build on top of Bootstrap or contribute to it:
78+
79+
- Native CSS nesting, so compiled output can stay nested
80+
- `@layer`, which our [layer order]([[docsref:/getting-started/approach]]) depends on
81+
- `:focus-visible` for keyboard-only focus styling
82+
- Container query units and `subgrid`
83+
- `content-visibility`, `transition-behavior: allow-discrete`, and `@starting-style`, which together animate `<details>` and `<dialog>` open and closed
84+
- Unprefixed `backdrop-filter`
85+
- `text-wrap: balance`
86+
- Range syntax in media queries, such as `@media (width >= 1024px)`
87+
88+
### Not available yet
89+
90+
These features sit above our floors, so v6 cannot use them without a fallback. Firefox is the blocker in nearly every case, which means Chrome support alone is never enough to tell you whether we can ship something.
91+
92+
<BsTable>
93+
| Feature | First fully supported in |
94+
| --- | --- |
95+
| Relative color syntax, `rgb(from …)` | Chrome 131, Firefox 133 |
96+
| View transitions | Firefox 144 |
97+
| `@scope` | Firefox 146 |
98+
| Anchor positioning | Firefox 147, Safari 26 |
99+
| Style container queries | Firefox 151 |
100+
| `text-box-trim` | Firefox 154 |
101+
| Scrollbar styling | Safari 26.2 |
102+
</BsTable>
103+
104+
Relative color syntax is the closest miss, one version above our Chrome floor. Anchor positioning is the one most worth waiting for: it would let Menu, Tooltip, Popover, and Combobox drop their [Floating UI](https://floating-ui.com/) dependency. Re-check these with `npx browserslist` before you assume one has landed.
105+
75106
## JavaScript
76107

77108
Bootstrap’s JavaScript ships as **native ES modules only**. Load it with `<script type="module">`—a classic `<script src>` without `type="module"` will not execute it, and there is no global `window.bootstrap` object. See the [JavaScript getting-started guide]([[docsref:/getting-started/javascript]]) for loading patterns, including import maps for the bundle’s dependencies.
@@ -80,7 +111,7 @@ All browsers meeting the CSS support floor above fully support ES modules, `impo
80111

81112
## Mobile devices
82113

83-
Generally speaking, Bootstrap supports the latest versions of each major platform’s default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile’s Turbo mode, UC Browser Mini, Amazon Silk) are not supported. We also exclude UC Browser, QQ Browser, and KaiOS. Together they hold under 1% of users, and targeting them only adds vendor prefixes to our CSS.
114+
Generally speaking, Bootstrap supports the latest versions of each major platform’s default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile’s Turbo mode, UC Browser Mini, Amazon Silk) are not supported. We also exclude UC Browser, QQ Browser, and KaiOS. Together they hold under 1% of users, and including them only adds vendor prefixes to our CSS: `-webkit-mask-*` for UC and QQ, and `-moz-column-gap` for KaiOS. KaiOS additionally [broke our floating labels](https://github.com/postcss/autoprefixer/issues/1533).
84115

85116
<BsTable>
86117
| Platform | Supported browsers |

0 commit comments

Comments
 (0)