From fec511da025c39b40fa94da1c047688fa95dd577 Mon Sep 17 00:00:00 2001
From: kyletsang <6854874+kyletsang@users.noreply.github.com>
Date: Sat, 27 Jun 2020 23:23:51 -0700
Subject: [PATCH 01/69] Docs: Fix vertical align link
---
site/content/docs/5.0/utilities/vertical-align.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/site/content/docs/5.0/utilities/vertical-align.md b/site/content/docs/5.0/utilities/vertical-align.md
index 730133600..f7cf2207b 100644
--- a/site/content/docs/5.0/utilities/vertical-align.md
+++ b/site/content/docs/5.0/utilities/vertical-align.md
@@ -9,7 +9,7 @@ Change the alignment of elements with the [`vertical-alignment`](https://develop
Choose from `.align-baseline`, `.align-top`, `.align-middle`, `.align-bottom`, `.align-text-bottom`, and `.align-text-top` as needed.
-To vertically center non-inline content (like `
`s and more), use our [flex box utilities]({{< docsref "/utilities/flex#auto-margins" >}}).
+To vertically center non-inline content (like `
`s and more), use our [flex box utilities]({{< docsref "/utilities/flex#align-items" >}}).
With inline elements:
From b5fb84a91d43d5178c3a6732355f346fdc3a113c Mon Sep 17 00:00:00 2001
From: XhmikosR
Date: Thu, 17 Sep 2020 20:01:04 +0300
Subject: [PATCH 02/69] docs: fix a few redirects (#31689)
* Fix GitHub's permanent redirects
* Fix a11yproject redirects
* Update postcss-loader repo URL to the current one
---
.github/CONTRIBUTING.md | 2 +-
README.md | 4 ++--
scss/mixins/_visually-hidden.scss | 2 +-
site/content/docs/5.0/getting-started/accessibility.md | 2 +-
site/content/docs/5.0/getting-started/webpack.md | 2 +-
site/layouts/_default/docs.html | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 75841c222..34da5de09 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -215,7 +215,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).
-- 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://a11yproject.com/posts/never-remove-css-outlines/) for more details.
+- 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
diff --git a/README.md b/README.md
index d018bc2d0..b3caa9072 100644
--- a/README.md
+++ b/README.md
@@ -68,8 +68,8 @@ Read the [Getting started page](https://v5.getbootstrap.com/docs/5.0/getting-sta
[](https://david-dm.org/twbs/bootstrap?type=peer)
[](https://david-dm.org/twbs/bootstrap?type=dev)
[](https://coveralls.io/github/twbs/bootstrap?branch=main)
-[](https://github.com/twbs/bootstrap/tree/main/dist/css/bootstrap.min.css)
-[](https://github.com/twbs/bootstrap/tree/main/dist/js/bootstrap.min.js)
+[](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
+[](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
[](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)
[](#backers)
[](#sponsors)
diff --git a/scss/mixins/_visually-hidden.scss b/scss/mixins/_visually-hidden.scss
index 26edfe84b..d980696c8 100644
--- a/scss/mixins/_visually-hidden.scss
+++ b/scss/mixins/_visually-hidden.scss
@@ -2,7 +2,7 @@
// Hide content visually while keeping it accessible to assistive technologies
//
-// See: https://a11yproject.com/posts/how-to-hide-content/
+// See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
@mixin visually-hidden() {
diff --git a/site/content/docs/5.0/getting-started/accessibility.md b/site/content/docs/5.0/getting-started/accessibility.md
index 022efcc20..150c80d65 100644
--- a/site/content/docs/5.0/getting-started/accessibility.md
+++ b/site/content/docs/5.0/getting-started/accessibility.md
@@ -50,7 +50,7 @@ Bootstrap includes support for the [`prefers-reduced-motion` media feature](http
## Additional resources
- [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/TR/WCAG21/)
-- [The A11Y Project](https://a11yproject.com/)
+- [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/)
- [Color Contrast Analyser (CCA)](https://developer.paciellogroup.com/resources/contrastanalyser/)
diff --git a/site/content/docs/5.0/getting-started/webpack.md b/site/content/docs/5.0/getting-started/webpack.md
index 10e536bbf..c67152f8d 100644
--- a/site/content/docs/5.0/getting-started/webpack.md
+++ b/site/content/docs/5.0/getting-started/webpack.md
@@ -42,7 +42,7 @@ First, create your own `_custom.scss` and use it to override the [built-in custo
@import "~bootstrap/scss/bootstrap";
{{< /highlight >}}
-For Bootstrap to compile, make sure you install and use the required loaders: [sass-loader](https://github.com/webpack-contrib/sass-loader), [postcss-loader](https://github.com/postcss/postcss-loader) with [Autoprefixer](https://github.com/postcss/autoprefixer#webpack). With minimal setup, your webpack config should include this rule or similar:
+For Bootstrap to compile, make sure you install and use the required loaders: [sass-loader](https://github.com/webpack-contrib/sass-loader), [postcss-loader](https://github.com/webpack-contrib/postcss-loader) with [Autoprefixer](https://github.com/postcss/autoprefixer#webpack). With minimal setup, your webpack config should include this rule or similar:
{{< highlight js >}}
...
diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html
index 5d390a5f8..d54e2a9fd 100644
--- a/site/layouts/_default/docs.html
+++ b/site/layouts/_default/docs.html
@@ -17,7 +17,7 @@
From 26c1fbe839482bf152cefcf57aa8797549fd8387 Mon Sep 17 00:00:00 2001
From: Matthew Orahood
Date: Wed, 16 Sep 2020 06:01:31 -0400
Subject: [PATCH 03/69] Update webpack.md
potcss-loader now uses the `postcssOptions` key. https://www.npmjs.com/package/postcss-loader
---
site/content/docs/5.0/getting-started/webpack.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/site/content/docs/5.0/getting-started/webpack.md b/site/content/docs/5.0/getting-started/webpack.md
index c67152f8d..693f96109 100644
--- a/site/content/docs/5.0/getting-started/webpack.md
+++ b/site/content/docs/5.0/getting-started/webpack.md
@@ -55,10 +55,12 @@ For Bootstrap to compile, make sure you install and use the required loaders: [s
}, {
loader: 'postcss-loader', // Run postcss actions
options: {
- plugins: function () { // postcss plugins, can be exported to postcss.config.js
- return [
- require('autoprefixer')
- ];
+ postcssOptions: {
+ plugins: function () { // post css plugins, can be exported to postcss.config.js
+ return [
+ require('autoprefixer')
+ ];
+ }
}
}
}, {
From 4e9a29e47ae776064b5afe931a347d61a4390451 Mon Sep 17 00:00:00 2001
From: XhmikosR
Date: Fri, 18 Sep 2020 14:53:44 +0300
Subject: [PATCH 04/69] Update webpack.md
Format snippets
---
.../docs/5.0/getting-started/webpack.md | 32 ++++++++++++-------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/site/content/docs/5.0/getting-started/webpack.md b/site/content/docs/5.0/getting-started/webpack.md
index 693f96109..89870a684 100644
--- a/site/content/docs/5.0/getting-started/webpack.md
+++ b/site/content/docs/5.0/getting-started/webpack.md
@@ -45,18 +45,24 @@ First, create your own `_custom.scss` and use it to override the [built-in custo
For Bootstrap to compile, make sure you install and use the required loaders: [sass-loader](https://github.com/webpack-contrib/sass-loader), [postcss-loader](https://github.com/webpack-contrib/postcss-loader) with [Autoprefixer](https://github.com/postcss/autoprefixer#webpack). With minimal setup, your webpack config should include this rule or similar:
{{< highlight js >}}
-...
+// ...
{
test: /\.(scss)$/,
use: [{
- loader: 'style-loader', // inject CSS to page
+ // inject CSS to page
+ loader: 'style-loader'
}, {
- loader: 'css-loader', // translates CSS into CommonJS modules
+ // translates CSS into CommonJS modules
+ loader: 'css-loader'
}, {
- loader: 'postcss-loader', // Run postcss actions
+ // Run postcss actions
+ loader: 'postcss-loader',
options: {
+ // `postcssOptions` is needed for postcss 8.x;
+ // if you use postcss 7.x skip the key
postcssOptions: {
- plugins: function () { // post css plugins, can be exported to postcss.config.js
+ // postcss plugins, can be exported to postcss.config.js
+ plugins: function () {
return [
require('autoprefixer')
];
@@ -64,10 +70,11 @@ For Bootstrap to compile, make sure you install and use the required loaders: [s
}
}
}, {
- loader: 'sass-loader' // compiles Sass to CSS
+ // compiles Sass to CSS
+ loader: 'sass-loader'
}]
-},
-...
+}
+// ...
{{< /highlight >}}
### Importing Compiled CSS
@@ -81,14 +88,17 @@ import 'bootstrap/dist/css/bootstrap.min.css';
In this case you may use your existing rule for `css` without any special modifications to webpack config, except you don't need `sass-loader` just [style-loader](https://github.com/webpack-contrib/style-loader) and [css-loader](https://github.com/webpack-contrib/css-loader).
{{< highlight js >}}
-...
+// ...
module: {
rules: [
{
test: /\.css$/,
- use: ['style-loader', 'css-loader']
+ use: [
+ 'style-loader',
+ 'css-loader'
+ ]
}
]
}
-...
+// ...
{{< /highlight >}}
From 7bbfd439c9d647cdfc1c4ec3bef57911cddfb00d Mon Sep 17 00:00:00 2001
From: Jaume Sala
Date: Mon, 21 Sep 2020 04:42:41 +0200
Subject: [PATCH 05/69] Extra position utilities (#31280)
* Extra position utilities
Given that there are utilities for the *position* property, it seems logic to have utilities for the *top*, *left*, *bottom* and *right* propertires.
* Update extra position utilities
* add default position values map
* tweak examples
* add real life examples
* fix double colon
Co-authored-by: XhmikosR
---
scss/_utilities.scss | 23 ++++++
scss/_variables.scss | 11 +++
site/assets/scss/_component-examples.scss | 23 ++++++
site/content/docs/5.0/utilities/position.md | 84 ++++++++++++++++++++-
4 files changed, 140 insertions(+), 1 deletion(-)
diff --git a/scss/_utilities.scss b/scss/_utilities.scss
index 69615ec4e..e9a9b1e33 100644
--- a/scss/_utilities.scss
+++ b/scss/_utilities.scss
@@ -39,6 +39,29 @@ $utilities: map-merge(
property: position,
values: static relative absolute fixed sticky
),
+ "top": (
+ property: top,
+ values: $position-values
+ ),
+ "bottom": (
+ property: bottom,
+ values: $position-values
+ ),
+ "left": (
+ property: left,
+ values: $position-values
+ ),
+ "right": (
+ property: right,
+ values: $position-values
+ ),
+ "translate-middle": (
+ property: transform,
+ class: translate-middle,
+ values: (
+ null: (translateX(-50%) translateY(-50%))
+ )
+ ),
"border": (
property: border,
values: (
diff --git a/scss/_variables.scss b/scss/_variables.scss
index bdf2d62a4..610a56962 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -246,6 +246,17 @@ $spacers: (
$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;
+// Position
+//
+// Define the edge positioning anchors of the position utilities.
+
+$position-values: (
+ 0: 0,
+ 50: 50%,
+ 100: 100%
+) !default;
+
+
// Body
//
// Settings for the `` element.
diff --git a/site/assets/scss/_component-examples.scss b/site/assets/scss/_component-examples.scss
index 4b7aa4355..7391f5998 100644
--- a/site/assets/scss/_component-examples.scss
+++ b/site/assets/scss/_component-examples.scss
@@ -217,6 +217,29 @@
}
}
+.bd-example-position-utils {
+ position: relative;
+ padding: 3em;
+
+ .position-relative {
+ height: 200px;
+ background-color: #f5f5f5;
+ }
+
+ .position-absolute {
+ width: 2em;
+ height: 2em;
+ background-color: $dark;
+ @include border-radius();
+ }
+}
+
+.bd-example-position-examples {
+ &::after {
+ content: none;
+ }
+}
+
//
// Code snippets
//
diff --git a/site/content/docs/5.0/utilities/position.md b/site/content/docs/5.0/utilities/position.md
index 4af457da4..8928ecd81 100644
--- a/site/content/docs/5.0/utilities/position.md
+++ b/site/content/docs/5.0/utilities/position.md
@@ -6,7 +6,7 @@ group: utilities
toc: true
---
-## Common values
+## Position values
Quick positioning classes are available, though they are not responsive.
@@ -17,3 +17,85 @@ Quick positioning classes are available, though they are not responsive.
...
...
{{< /highlight >}}
+
+## Arrange elements
+
+Arrange elements easily with the edge positioning utilities. The format is `{property}-{position}`.
+
+Where *property* is one of:
+
+- `top` - for the vertical `top` position
+- `left` - for the horizontal `left` position
+- `bottom` - for the vertical `bottom` position
+- `right` - for the horizontal `right` position
+
+Where *position* is one of:
+
+- `0` - for `0` edge position
+- `50` - for `50%` edge position
+- `100` - for `100%` edge position
+
+(You can add more position values by adding entries to the `$position-values` Sass map variable.)
+
+{{< example class="bd-example-position-utils" >}}
+
+
+
+
+
+
+
+
+{{< /example >}}
+
+## Center elements
+
+In addition, you can also center the elements with the transform utility class `.translate-middle`.
+
+This class applies the transformations `translateX(-50%)` and `translateY(-50%)` to the element which, in combination with the edge positioning utilities, allows you to absolute center an element.
+
+{{< example class="bd-example-position-utils" >}}
+
+
+
+
+
+
+
+
+
+
+
+{{< /example >}}
+
+## Examples
+
+Here are some real life examples of these classes:
+
+{{< example class="bd-example-position-examples d-flex justify-content-around" >}}
+
+
+
+
+
+{{< /example >}}
+
+You can use these classes with existing components to create new ones. Remember that you can extend its functionality by adding entries to the `$position-values` variable.
+
+{{< example class="bd-example-position-examples" >}}
+
+
+
+
+
+
+
+
+{{< /example >}}
+
From bb794bf9046dec3bb8a49eb82fefccf7c6381f91 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2020 11:45:30 +0300
Subject: [PATCH 06/69] Bump eslint-plugin-unicorn from 21.0.0 to 22.0.0
(#31723)
Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 21.0.0 to 22.0.0.
- [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases)
- [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v21.0.0...v22.0.0)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package-lock.json | 10 +++++-----
package.json | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 284d05192..17d070c5b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4141,18 +4141,18 @@
}
},
"eslint-plugin-unicorn": {
- "version": "21.0.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-21.0.0.tgz",
- "integrity": "sha512-S8v7+v4gZTQPj4pKKvexhgSUaLQSyItvxW2SVZDaX9Iu5IjlAmF2eni+L6w8a2aqshxgU8Lle4FIAVDtuejSKQ==",
+ "version": "22.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-22.0.0.tgz",
+ "integrity": "sha512-jXPOauNiVFYLr+AeU3l21Ao+iDl/G08vUWui21RCI2L1TJIIoJvAMjMR6I+QPKr8FgIumzuR6gzDKCtEx2IkzA==",
"dev": true,
"requires": {
"ci-info": "^2.0.0",
"clean-regexp": "^1.0.0",
"eslint-ast-utils": "^1.1.0",
- "eslint-template-visitor": "^2.0.0",
+ "eslint-template-visitor": "^2.2.1",
"eslint-utils": "^2.1.0",
"import-modules": "^2.0.0",
- "lodash": "^4.17.15",
+ "lodash": "^4.17.20",
"pluralize": "^8.0.0",
"read-pkg-up": "^7.0.1",
"regexp-tree": "^0.1.21",
diff --git a/package.json b/package.json
index 5f8c352fa..d91cc26a8 100644
--- a/package.json
+++ b/package.json
@@ -105,7 +105,7 @@
"eslint": "^7.9.0",
"eslint-config-xo": "^0.32.1",
"eslint-plugin-import": "^2.22.0",
- "eslint-plugin-unicorn": "^21.0.0",
+ "eslint-plugin-unicorn": "^22.0.0",
"find-unused-sass-variables": "^2.0.0",
"glob": "^7.1.6",
"hammer-simulator": "0.0.1",
From 5706ce38eba781838b64d8aa6e19f03a15e5cdc4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2020 11:50:14 +0300
Subject: [PATCH 07/69] Bump @rollup/plugin-commonjs from 15.0.0 to 15.1.0
(#31724)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins) from 15.0.0 to 15.1.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/commonjs-v15.0.0...commonjs-v15.1.0)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR
---
package-lock.json | 6 +++---
package.json | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 17d070c5b..46b75f2de 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1151,9 +1151,9 @@
}
},
"@rollup/plugin-commonjs": {
- "version": "15.0.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz",
- "integrity": "sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==",
+ "version": "15.1.0",
+ "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz",
+ "integrity": "sha512-xCQqz4z/o0h2syQ7d9LskIMvBSH4PX5PjYdpSSvgS+pQik3WahkQVNWg3D8XJeYjZoVWnIUQYDghuEMRGrmQYQ==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.1.0",
diff --git a/package.json b/package.json
index d91cc26a8..dc77037ef 100644
--- a/package.json
+++ b/package.json
@@ -96,7 +96,7 @@
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@rollup/plugin-babel": "^5.2.1",
- "@rollup/plugin-commonjs": "^15.0.0",
+ "@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"autoprefixer": "^9.8.6",
"bundlewatch": "^0.3.0",
From 6b1cdd099041f2971cb9456a4cf3b27306909194 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 22 Sep 2020 11:53:57 +0300
Subject: [PATCH 08/69] Bump rollup from 2.26.11 to 2.28.1 (#31725)
Bumps [rollup](https://github.com/rollup/rollup) from 2.26.11 to 2.28.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.26.11...v2.28.1)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR
---
package-lock.json | 6 +++---
package.json | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 46b75f2de..56d1db30a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9868,9 +9868,9 @@
}
},
"rollup": {
- "version": "2.26.11",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.11.tgz",
- "integrity": "sha512-xyfxxhsE6hW57xhfL1I+ixH8l2bdoIMaAecdQiWF3N7IgJEMu99JG+daBiSZQjnBpzFxa0/xZm+3pbCdAQehHw==",
+ "version": "2.28.1",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.28.1.tgz",
+ "integrity": "sha512-DOtVoqOZt3+FjPJWLU8hDIvBjUylc9s6IZvy76XklxzcLvAQLtVAG/bbhsMhcWnYxC0TKKcf1QQ/tg29zeID0Q==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
diff --git a/package.json b/package.json
index dc77037ef..9093ead10 100644
--- a/package.json
+++ b/package.json
@@ -128,7 +128,7 @@
"npm-run-all": "^4.1.5",
"popper.js": "^1.16.1",
"postcss-cli": "^7.1.2",
- "rollup": "^2.26.11",
+ "rollup": "^2.28.1",
"rollup-plugin-istanbul": "^2.0.1",
"shelljs": "^0.8.4",
"sirv-cli": "^1.0.6",
From fe77208a01b9b41ce13a9c68139d9f1618c48ec9 Mon Sep 17 00:00:00 2001
From: Mark Otto
Date: Mon, 21 Sep 2020 16:27:26 -0700
Subject: [PATCH 09/69] Add new variable for -padding-x
---
scss/_dropdown.scss | 2 +-
scss/_variables.scss | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/scss/_dropdown.scss b/scss/_dropdown.scss
index b30f2ba7e..f87fc8eb9 100644
--- a/scss/_dropdown.scss
+++ b/scss/_dropdown.scss
@@ -21,7 +21,7 @@
z-index: $zindex-dropdown;
display: none; // none by default, but block on "open" of the menu
min-width: $dropdown-min-width;
- padding: $dropdown-padding-y 0;
+ padding: $dropdown-padding-y $dropdown-padding-x;
margin: $dropdown-spacer 0 0; // override default ul
@include font-size($dropdown-font-size);
color: $dropdown-color;
diff --git a/scss/_variables.scss b/scss/_variables.scss
index 610a56962..be8c014b3 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -928,6 +928,7 @@ $navbar-dark-brand-hover-color: $navbar-dark-active-color !default;
// Dropdown menu container and contents.
$dropdown-min-width: 10rem !default;
+$dropdown-padding-x: 0 !default;
$dropdown-padding-y: .5rem !default;
$dropdown-spacer: .125rem !default;
$dropdown-font-size: $font-size-base !default;
From 99777662c678341b0220630c05a9526faab36c95 Mon Sep 17 00:00:00 2001
From: Mark Otto
Date: Tue, 1 Sep 2020 15:16:50 -0700
Subject: [PATCH 10/69] Rename .close to .btn-close, replace times sign with
background SVG, update focus state
---
scss/_alert.scss | 7 +-
scss/_close.scss | 42 +++++-----
scss/_modal.scss | 2 +-
scss/_variables.scss | 12 +--
site/content/docs/5.0/components/alerts.md | 4 +-
.../docs/5.0/components/close-button.md | 11 +--
site/content/docs/5.0/components/modal.md | 76 +++++--------------
7 files changed, 55 insertions(+), 99 deletions(-)
diff --git a/scss/_alert.scss b/scss/_alert.scss
index 19157b298..078aaaa68 100644
--- a/scss/_alert.scss
+++ b/scss/_alert.scss
@@ -27,15 +27,14 @@
// Expand the right padding and account for the close button's positioning.
.alert-dismissible {
- padding-right: $close-font-size + $alert-padding-x * 2;
+ padding-right: $alert-padding-x * 3.5;
// Adjust close link position
- .close {
+ .btn-close {
position: absolute;
top: 0;
right: 0;
- padding: $alert-padding-y $alert-padding-x;
- color: inherit;
+ padding: $alert-padding-y * 1.25 $alert-padding-x;
}
}
diff --git a/scss/_close.scss b/scss/_close.scss
index dd6541e0d..6bc621f06 100644
--- a/scss/_close.scss
+++ b/scss/_close.scss
@@ -1,36 +1,36 @@
-.close {
- @include font-size($close-font-size);
- font-weight: $close-font-weight;
- line-height: 1;
- color: $close-color;
- text-shadow: $close-text-shadow;
+// transparent background and border properties included for button version.
+// iOS requires the button element instead of an anchor tag.
+// If you want the anchor version, it requires `href="#"`.
+// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
+
+.btn-close {
+ box-sizing: content-box;
+ width: $btn-close-width;
+ height: $btn-close-height;
+ padding: $btn-close-padding-y $btn-close-padding-x;
+ color: $btn-close-color;
+ background: transparent escape-svg($btn-close-bg) no-repeat center center / $btn-close-width auto; // include transparent for button elements
+ background-clip: content-box;
+ border: 0; // for button elements
+ @include border-radius();
opacity: .5;
// Override 's hover style
&:hover {
- color: $close-color;
+ color: $btn-close-color;
text-decoration: none;
+ opacity: .75;
}
- &:hover,
&:focus {
- opacity: .75;
+ outline: none;
+ box-shadow: $btn-close-focus-shadow;
+ opacity: 1;
}
&:disabled,
&.disabled {
pointer-events: none;
+ user-select: none;
}
}
-
-// Additional properties for button version
-// iOS requires the button element instead of an anchor tag.
-// If you want the anchor version, it requires `href="#"`.
-// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
-
-// stylelint-disable-next-line selector-no-qualifying-type
-button.close {
- padding: 0;
- background-color: transparent;
- border: 0;
-}
diff --git a/scss/_modal.scss b/scss/_modal.scss
index 5443ef124..9cf3aa89a 100644
--- a/scss/_modal.scss
+++ b/scss/_modal.scss
@@ -118,7 +118,7 @@
border-bottom: $modal-header-border-width solid $modal-header-border-color;
@include border-top-radius($modal-content-inner-border-radius);
- .close {
+ .btn-close {
padding: $modal-header-padding;
// auto on the left force icon to the right even when there is no .modal-title
margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
diff --git a/scss/_variables.scss b/scss/_variables.scss
index be8c014b3..266a497a7 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -1269,11 +1269,13 @@ $spinner-border-width-sm: .2em !default;
// Close
-$close-font-size: $font-size-base * 1.5 !default;
-$close-font-weight: $font-weight-bold !default;
-$close-color: $black !default;
-$close-text-shadow: 0 1px 0 $white !default;
-
+$btn-close-width: 1em !default;
+$btn-close-height: $btn-close-width !default;
+$btn-close-padding-x: .25em !default;
+$btn-close-padding-y: $btn-close-padding-x !default;
+$btn-close-color: $black !default;
+$btn-close-bg: url("data:image/svg+xml,") !default;
+$btn-close-focus-shadow: $input-btn-focus-box-shadow !default;
// Code
diff --git a/site/content/docs/5.0/components/alerts.md b/site/content/docs/5.0/components/alerts.md
index dace2f718..c58e93a23 100644
--- a/site/content/docs/5.0/components/alerts.md
+++ b/site/content/docs/5.0/components/alerts.md
@@ -66,9 +66,7 @@ You can see this in action with a live demo:
{{< example >}}