Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
caioalvesbraga authored Aug 14, 2024
2 parents 16cfc14 + 048f56f commit 12a7a6d
Show file tree
Hide file tree
Showing 47 changed files with 1,884 additions and 1,165 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ includes code changes) and under the terms of the

[Adhere to the Code Guide.](https://codeguide.co/#css)

- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG20/#visual-audio-contrast).
- When feasible, default color palettes should comply with [WCAG color contrast guidelines](https://www.w3.org/TR/WCAG/#distinguishable).
- Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](https://www.a11yproject.com/posts/2013-01-25-never-remove-css-outlines/) for more details.
### JS
Expand Down
2 changes: 1 addition & 1 deletion js/src/dom/manipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Manipulator = {

for (const key of bsKeys) {
let pureKey = key.replace(/^bs/, '')
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1)
attributes[pureKey] = normalizeData(element.dataset[key])
}

Expand Down
2,914 changes: 1,818 additions & 1,096 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@
},
"devDependencies": {
"@babel/cli": "^7.24.8",
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@docsearch/js": "^3.6.0",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@docsearch/js": "^3.6.1",
"@popperjs/core": "^2.11.8",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@stackblitz/sdk": "^1.11.0",
"autoprefixer": "^10.4.19",
"bundlewatch": "^0.3.3",
"autoprefixer": "^10.4.20",
"bundlewatch": "^0.4.0",
"clean-css-cli": "^5.6.3",
"clipboard": "^2.0.11",
"cross-env": "^7.0.3",
Expand All @@ -123,15 +123,15 @@
"eslint-plugin-html": "^8.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"find-unused-sass-variables": "^6.0.0",
"globby": "^14.0.1",
"globby": "^14.0.2",
"hammer-simulator": "0.0.1",
"hugo-bin": "^0.125.2",
"hugo-bin": "^0.129.1",
"ip": "^2.0.1",
"jasmine": "^5.1.0",
"jasmine": "^5.2.0",
"jquery": "^3.7.1",
"karma": "^6.4.3",
"karma": "^6.4.4",
"karma-browserstack-launcher": "1.4.0",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
Expand All @@ -143,17 +143,17 @@
"lockfile-lint": "^4.14.0",
"nodemon": "^3.1.4",
"npm-run-all2": "^6.2.2",
"postcss": "^8.4.39",
"postcss": "^8.4.41",
"postcss-cli": "^11.0.0",
"rollup": "^4.18.1",
"rollup": "^4.20.0",
"rollup-plugin-istanbul": "^5.0.0",
"rtlcss": "^4.1.1",
"rtlcss": "^4.2.0",
"sass": "^1.77.8",
"sass-true": "^8.0.0",
"shelljs": "^0.8.5",
"stylelint": "^16.7.0",
"stylelint": "^16.8.1",
"stylelint-config-twbs-bootstrap": "^14.2.0",
"terser": "^5.31.2",
"terser": "^5.31.6",
"vnu-jar": "23.4.11"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
@return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
}

// Return WCAG2.1 relative luminance
// Return WCAG2.2 relative luminance
// See https://www.w3.org/TR/WCAG/#dfn-relative-luminance
// See https://www.w3.org/TR/WCAG/#dfn-contrast-ratio
@function luminance($color) {
Expand Down
4 changes: 2 additions & 2 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ $colors: (
) !default;
// scss-docs-end colors-map

// The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
// See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
// The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.2 are 3, 4.5 and 7.
// See https://www.w3.org/TR/WCAG/#contrast-minimum
$min-contrast-ratio: 4.5 !default;

// Customize the light and dark text colors for use in our color contrast function.
Expand Down
2 changes: 1 addition & 1 deletion scss/mixins/_visually-hidden.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Use to only display content when it's focused, or one of its child elements is focused
// (i.e. when focus is within the element/container that the class was applied to)
//
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
// Useful for "Skip to main content" links; see https://www.w3.org/WAI/WCAG22/Techniques/general/G1.html

@mixin visually-hidden-focusable() {
&:not(:focus):not(:focus-within) {
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/components/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ You can make your carousels autoplay on page load by setting the `ride` option t
{{< callout info >}}
For accessibility reasons, we recommend avoiding the use of autoplaying carousels. If your page does include an autoplaying carousel, we recommend providing an additional button or control to explicitly pause/stop the carousel.

See [WCAG 2.1 Success Criterion 2.2.2 Pause, Stop, Hide](https://www.w3.org/TR/WCAG21/#pause-stop-hide).
See [WCAG 2.2 Success Criterion 2.2.2 Pause, Stop, Hide](https://www.w3.org/TR/WCAG/#pause-stop-hide).
{{< /callout >}}

{{< example >}}
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/components/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The best part is you can do this with any button variant, too:
<!-- Example single danger button -->
<div class="btn-group">
<button type="button" class="btn btn-danger dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Action
Danger
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
Expand Down Expand Up @@ -228,7 +228,7 @@ We use this extra class to reduce the horizontal `padding` on either side of the
```html
<!-- Example split danger button -->
<div class="btn-group">
<button type="button" class="btn btn-danger">Action</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/buttons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
<div class="d-flex gap-2 justify-content-center py-5">
<button class="btn btn-primary d-inline-flex align-items-center" type="button">
Primary icon
<svg class="bi ms-1" width="20" height="20"><use xlink:href="#arrow-right-short"/></svg>
<svg class="bi ms-1" width="20" height="20" aria-hidden="true"><use xlink:href="#arrow-right-short"/></svg>
</button>
<button class="btn btn-outline-secondary d-inline-flex align-items-center" type="button">
Secondary icon
<svg class="bi ms-1" width="20" height="20"><use xlink:href="#arrow-right-short"/></svg>
<svg class="bi ms-1" width="20" height="20" aria-hidden="true"><use xlink:href="#arrow-right-short"/></svg>
</button>
</div>

Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/examples/dropdowns/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<option value="December">December</option>
</select>
<button class="btn cal-btn" type="button" aria-label="next month">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-short"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-short"/></svg>
</button>
</div>
<div class="cal-weekdays text-body-secondary">
Expand Down Expand Up @@ -306,7 +306,7 @@
<option value="December">December</option>
</select>
<button class="btn cal-btn" type="button" aria-label="next month">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-short"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-short"/></svg>
</button>
</div>
<div class="cal-weekdays text-body-secondary">
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/examples/jumbotrons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1 class="text-body-emphasis">Jumbotron with icon</h1>
<div class="d-inline-flex gap-2 mb-5">
<button class="d-inline-flex align-items-center btn btn-primary btn-lg px-4 rounded-pill" type="button">
Call to action
<svg class="bi ms-2" width="24" height="24"><use xlink:href="#arrow-right-short"/></svg>
<svg class="bi ms-2" width="24" height="24" aria-hidden="true"><use xlink:href="#arrow-right-short"/></svg>
</button>
<button class="btn btn-outline-secondary btn-lg px-4 rounded-pill" type="button">
Secondary link
Expand Down
18 changes: 9 additions & 9 deletions site/content/docs/5.3/examples/starter-template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ <h2 class="text-body-emphasis">Starter projects</h2>
<ul class="list-unstyled ps-0">
<li>
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/icons-font" rel="noopener" target="_blank">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap npm starter
</a>
</li>
<li>
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/parcel" rel="noopener" target="_blank">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Parcel starter
</a>
</li>
<li>
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/vite" rel="noopener" target="_blank">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Vite starter
</a>
</li>
<li>
<a class="icon-link mb-1" href="https://github.com/twbs/examples/tree/main/webpack" rel="noopener" target="_blank">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Webpack starter
</a>
</li>
Expand All @@ -69,31 +69,31 @@ <h2 class="text-body-emphasis">Guides</h2>
<ul class="list-unstyled ps-0">
<li>
<a class="icon-link mb-1" href="{{< docsref "/getting-started/introduction" >}}">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap quick start guide
</a>
</li>
<li>
<a class="icon-link mb-1" href="{{< docsref "/getting-started/webpack" >}}">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Webpack guide
</a>
</li>
<li>
<a class="icon-link mb-1" href="{{< docsref "/getting-started/parcel" >}}">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Parcel guide
</a>
</li>
<li>
<a class="icon-link mb-1" href="{{< docsref "/getting-started/vite" >}}">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Bootstrap Vite guide
</a>
</li>
<li>
<a class="icon-link mb-1" href="{{< docsref "/getting-started/contribute" >}}">
<svg class="bi" width="16" height="16"><use xlink:href="#arrow-right-circle"/></svg>
<svg class="bi" width="16" height="16" aria-hidden="true"><use xlink:href="#arrow-right-circle"/></svg>
Contributing to Bootstrap
</a>
</li>
Expand Down
6 changes: 3 additions & 3 deletions site/content/docs/5.3/getting-started/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Bootstrap provides an easy-to-use framework of ready-made styles, layout tools,

## Overview and limitations

The overall accessibility of any project built with Bootstrap depends in large part on the author's markup, additional styling, and scripting they've included. However, provided that these have been implemented correctly, it should be perfectly possible to create websites and applications with Bootstrap that fulfill [<abbr title="Web Content Accessibility Guidelines">WCAG</abbr> 2.1](https://www.w3.org/TR/WCAG/) (A/AA/AAA), [Section 508](https://www.section508.gov/), and similar accessibility standards and requirements.
The overall accessibility of any project built with Bootstrap depends in large part on the author's markup, additional styling, and scripting they've included. However, provided that these have been implemented correctly, it should be perfectly possible to create websites and applications with Bootstrap that fulfill [<abbr title="Web Content Accessibility Guidelines">WCAG</abbr> 2.2](https://www.w3.org/TR/WCAG/) (A/AA/AAA), [Section 508](https://www.section508.gov/), and similar accessibility standards and requirements.

### Structural markup

Expand All @@ -24,7 +24,7 @@ Because Bootstrap's components are purposely designed to be fairly generic, auth

### Color contrast

Some combinations of colors that currently make up Bootstrap's default palette—used throughout the framework for things such as button variations, alert variations, form validation indicators—may lead to *insufficient* color contrast (below the recommended [WCAG 2.1 text color contrast ratio of 4.5:1](https://www.w3.org/TR/WCAG/#contrast-minimum) and the [WCAG 2.1 non-text color contrast ratio of 3:1](https://www.w3.org/TR/WCAG/#non-text-contrast)), particularly when used against a light background. Authors are encouraged to test their specific uses of color and, where necessary, manually modify/extend these default colors to ensure adequate color contrast ratios.
Some combinations of colors that currently make up Bootstrap's default palette—used throughout the framework for things such as button variations, alert variations, form validation indicators—may lead to *insufficient* color contrast (below the recommended [WCAG 2.2 text color contrast ratio of 4.5:1](https://www.w3.org/TR/WCAG/#contrast-minimum) and the [WCAG 2.2 non-text color contrast ratio of 3:1](https://www.w3.org/TR/WCAG/#non-text-contrast)), particularly when used against a light background. Authors are encouraged to test their specific uses of color and, where necessary, manually modify/extend these default colors to ensure adequate color contrast ratios.

### Visually hidden content

Expand All @@ -51,7 +51,7 @@ On browsers that support `prefers-reduced-motion`, and where the user has *not*

## Additional resources

- [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/TR/WCAG/)
- [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG/)
- [The A11Y Project](https://www.a11yproject.com/)
- [MDN accessibility documentation](https://developer.mozilla.org/en-US/docs/Web/Accessibility)
- [Tenon.io Accessibility Checker](https://tenon.io/)
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ Want more information? [Read the v5.1.0 blog post.](https://blog.getbootstrap.co

- Added new tints and shades for every color, providing nine separate colors for each base color, as new Sass variables.

- Improved color contrast. Bumped color contrast ratio from 3:1 to 4.5:1 and updated blue, green, cyan, and pink colors to ensure WCAG 2.1 AA contrast. Also changed our color contrast color from `$gray-900` to `$black`.
- Improved color contrast. Bumped color contrast ratio from 3:1 to 4.5:1 and updated blue, green, cyan, and pink colors to ensure WCAG 2.2 AA contrast. Also changed our color contrast color from `$gray-900` to `$black`.

- To support our color system, we've added new custom `tint-color()` and `shade-color()` functions to mix our colors appropriately.

Expand Down
4 changes: 2 additions & 2 deletions site/layouts/partials/examples/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2 id="{{ $entry.category | urlize }}">{{ $entry.category }}</h2>
{{ if (eq $i 0) }}<div class="row">{{ end }}
{{ if $entry.external -}}
<div class="col-md-6 col-lg-4 mb-3 d-flex gap-3">
<svg class="bi fs-5 flex-shrink-0 mt-1"><use xlink:href="#box-seam"></use></svg>
<svg class="bi fs-5 flex-shrink-0 mt-1" aria-hidden="true"><use xlink:href="#box-seam"></use></svg>
<div>
<h3 class="h5 mb-1">
<a class="d-block link-offset-1" href="{{ urls.JoinPath $.Site.Params.github_org $example.url }}" target="_blank" rel="noopener">
Expand All @@ -27,7 +27,7 @@ <h3 class="h5 mb-1">
{{- $indexPath := default "index.html" $example.indexPath -}}
{{- $stackBlitzUrl := printf "%s%s%s" (urls.JoinPath "https://stackblitz.com/github/twbs" $example.url) "?file=" ($indexPath | urlquery) }}
<a class="icon-link small link-secondary link-offset-1" href="{{ $stackBlitzUrl }}" target="_blank" rel="noopener">
<svg class="bi flex-shrink-0"><use xlink:href="#lightning-charge-fill"></use></svg>
<svg class="bi flex-shrink-0" aria-hidden="true"><use xlink:href="#lightning-charge-fill"></use></svg>
Edit in StackBlitz
</a>
</p>
Expand Down
10 changes: 5 additions & 5 deletions site/layouts/partials/home/components-utilities.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<section class="pb-md-5 mb-5">
<div class="col-lg-8 mb-5">
<div class="masthead-followup-icon d-inline-block mb-3 me-2" style="--bg-rgb: var(--bs-danger-rgb);">
<svg class="bi fs-1"><use xlink:href="#menu-button-wide-fill"></use></svg>
<svg class="bi fs-1" aria-hidden="true"><use xlink:href="#menu-button-wide-fill"></use></svg>
</div>
<svg class="bi me-2 fs-2 text-body-secondary"><use xlink:href="#plus"></use></svg>
<svg class="bi me-2 fs-2 text-body-secondary" aria-hidden="true"><use xlink:href="#plus"></use></svg>
<div class="masthead-followup-icon d-inline-block mb-3" style="--bg-rgb: var(--bs-info-rgb);">
<svg class="bi fs-1"><use xlink:href="#braces-asterisk"></use></svg>
<svg class="bi fs-1" aria-hidden="true"><use xlink:href="#braces-asterisk"></use></svg>
</div>
<h2 class="display-5 mb-3 fw-semibold lh-sm">Components, meet the Utility&nbsp;API</h2>
<p class="lead fw-normal">
Expand Down Expand Up @@ -55,7 +55,7 @@ <h3 class="fw-semibold">Quickly customize components</h3>
<p class="d-flex justify-content-start mb-md-0">
<a href="/docs/{{ .Site.Params.docs_version }}/examples/#snippets" class="icon-link icon-link-hover fw-semibold">
Explore customized components
<svg class="bi"><use xlink:href="#arrow-right"></use></svg>
<svg class="bi" aria-hidden="true"><use xlink:href="#arrow-right"></use></svg>
</a>
</p>
</div>
Expand All @@ -80,7 +80,7 @@ <h3 class="fw-semibold">Create and extend utilities</h3>
<p class="d-flex justify-content-start mb-md-0">
<a href="/docs/{{ .Site.Params.docs_version }}/utilities/api/" class="icon-link icon-link-hover fw-semibold mb-3">
Explore the utility API
<svg class="bi"><use xlink:href="#arrow-right"></use></svg>
<svg class="bi" aria-hidden="true"><use xlink:href="#arrow-right"></use></svg>
</a>
</p>
</div>
Expand Down
Loading

0 comments on commit 12a7a6d

Please sign in to comment.