From 4278eb57ab1e9c48fb4f465867c38642b6eae0cc Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 15 Feb 2016 23:59:53 -0800 Subject: [PATCH 01/16] Add $small-font-size variable [skip sauce] [skip validator] --- scss/_type.scss | 2 +- scss/_variables.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scss/_type.scss b/scss/_type.scss index 1075757795..e3be17b22e 100644 --- a/scss/_type.scss +++ b/scss/_type.scss @@ -60,7 +60,7 @@ hr { small, .small { - font-size: 80%; + font-size: $small-font-size; font-weight: normal; } diff --git a/scss/_variables.scss b/scss/_variables.scss index e28b46711d..037683555a 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -193,6 +193,8 @@ $headings-color: inherit !default; $lead-font-size: 1.25rem !default; $lead-font-weight: 300 !default; +$small-font-size: 80% !default; + $text-muted: $gray-light !default; $abbr-border-color: $gray-light !default; From 1d634a07cef2ad418b6986bd93856b7ca7c529ca Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:18:30 -0800 Subject: [PATCH 02/16] Extract $label-padding-{x,y} variables [skip sauce] [skip validator] --- scss/_labels.scss | 2 +- scss/_variables.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scss/_labels.scss b/scss/_labels.scss index 6dec516085..fb4ef5aef7 100644 --- a/scss/_labels.scss +++ b/scss/_labels.scss @@ -5,7 +5,7 @@ .label { display: inline-block; - padding: .25em .4em; + padding: $label-padding-y $label-padding-x; font-size: 75%; font-weight: $label-font-weight; line-height: 1; diff --git a/scss/_variables.scss b/scss/_variables.scss index e28b46711d..77e60ff714 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -619,6 +619,8 @@ $label-danger-bg: $brand-danger !default; $label-color: #fff !default; $label-link-hover-color: #fff !default; $label-font-weight: bold !default; +$label-padding-x: .4em !default; +$label-padding-y: .25em !default; // Modals From c80cf45960c4d5c9719b8e9462d9b86eaa8d6c6b Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:23:53 -0800 Subject: [PATCH 03/16] Extract $label-pill-padding-x variable [skip sauce] [skip validator] --- scss/_labels.scss | 4 ++-- scss/_variables.scss | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scss/_labels.scss b/scss/_labels.scss index fb4ef5aef7..66af7c9c9f 100644 --- a/scss/_labels.scss +++ b/scss/_labels.scss @@ -43,8 +43,8 @@ a.label { // Make them extra rounded with a modifier to replace v3's badges. .label-pill { - padding-right: .6em; - padding-left: .6em; + padding-right: $label-pill-padding-x; + padding-left: $label-pill-padding-x; // Use a higher than normal value to ensure completely rounded edges when // customizing padding or font-size on labels. @include border-radius(10rem); diff --git a/scss/_variables.scss b/scss/_variables.scss index 77e60ff714..5c92cb21dd 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -622,6 +622,7 @@ $label-font-weight: bold !default; $label-padding-x: .4em !default; $label-padding-y: .25em !default; +$label-pill-padding-x: .6em !default; // Modals From 2c034cf5423e942ca47b632f60305522b4612898 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:27:53 -0800 Subject: [PATCH 04/16] Add $label-font-size variable in the name of not hardcoding values [skip sauce] [skip validator] --- scss/_labels.scss | 2 +- scss/_variables.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/_labels.scss b/scss/_labels.scss index fb4ef5aef7..cb8943978a 100644 --- a/scss/_labels.scss +++ b/scss/_labels.scss @@ -6,7 +6,7 @@ .label { display: inline-block; padding: $label-padding-y $label-padding-x; - font-size: 75%; + font-size: $label-font-size; font-weight: $label-font-weight; line-height: 1; color: $label-color; diff --git a/scss/_variables.scss b/scss/_variables.scss index 77e60ff714..4d2a0b1961 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -618,6 +618,7 @@ $label-danger-bg: $brand-danger !default; $label-color: #fff !default; $label-link-hover-color: #fff !default; +$label-font-size: 75% !default; $label-font-weight: bold !default; $label-padding-x: .4em !default; $label-padding-y: .25em !default; From 08d23959ac6dc21576442b5e1f89714cb482d6b2 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:30:40 -0800 Subject: [PATCH 05/16] Add $label-pill-border-radius variable [skip sauce] [skip validator] --- scss/_labels.scss | 4 +--- scss/_variables.scss | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scss/_labels.scss b/scss/_labels.scss index 66af7c9c9f..8d758ac89b 100644 --- a/scss/_labels.scss +++ b/scss/_labels.scss @@ -45,9 +45,7 @@ a.label { .label-pill { padding-right: $label-pill-padding-x; padding-left: $label-pill-padding-x; - // Use a higher than normal value to ensure completely rounded edges when - // customizing padding or font-size on labels. - @include border-radius(10rem); + @include border-radius($label-pill-border-radius); } // Colors diff --git a/scss/_variables.scss b/scss/_variables.scss index 5c92cb21dd..36eb9cd70c 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -623,6 +623,9 @@ $label-padding-x: .4em !default; $label-padding-y: .25em !default; $label-pill-padding-x: .6em !default; +// Use a higher than normal value to ensure completely rounded edges when +// customizing padding or font-size on labels. +$label-pill-border-radius: 10rem !default; // Modals From 4c6946b3a9bad22f15447460b9cf35fffad605d0 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:42:10 -0800 Subject: [PATCH 06/16] Extract $dropdown-min-width variable [skip sauce] [skip validator] --- 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 e76a56bca9..07ae2f1f65 100644 --- a/scss/_dropdown.scss +++ b/scss/_dropdown.scss @@ -42,7 +42,7 @@ z-index: $zindex-dropdown; display: none; // none by default, but block on "open" of the menu float: left; - min-width: 160px; + min-width: $dropdown-min-width; padding: 5px 0; margin: 2px 0 0; // override default ul font-size: $font-size-base; diff --git a/scss/_variables.scss b/scss/_variables.scss index 5c92cb21dd..4fbe3f0e85 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -426,6 +426,7 @@ $form-icon-danger: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www // // Dropdown menu container and contents. +$dropdown-min-width: 160px !default; $dropdown-bg: #fff !default; $dropdown-border-color: rgba(0,0,0,.15) !default; $dropdown-border-width: $border-width !default; From cdc0a7a748ce130335f0617753a15dda529f5f26 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 00:04:30 -0800 Subject: [PATCH 07/16] Introduce $mark-bg variable so that 's background-color can be customized independently of $state-warning-bg [skip sauce] [skip validator] --- scss/_type.scss | 2 +- scss/_variables.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/_type.scss b/scss/_type.scss index 1075757795..3bb3551509 100644 --- a/scss/_type.scss +++ b/scss/_type.scss @@ -67,7 +67,7 @@ small, mark, .mark { padding: .2em; - background-color: $state-warning-bg; + background-color: $mark-bg; } diff --git a/scss/_variables.scss b/scss/_variables.scss index 5c92cb21dd..d6680a45b0 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -549,6 +549,7 @@ $state-info-border: darken($state-info-bg, 7%) !default; $state-warning-text: #8a6d3b !default; $state-warning-bg: #fcf8e3 !default; +$mark-bg: $state-warning-bg !default; $state-warning-border: darken($state-warning-bg, 5%) !default; $state-danger-text: #a94442 !default; From ea1fa0528529a7155ef40e505a3650a44fd31b25 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 01:24:34 -0800 Subject: [PATCH 08/16] Change comment to clarify that $grid-breakpoints are minimum widths for each breakpoint (as opposed to maximums) [ci skip] --- scss/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/_variables.scss b/scss/_variables.scss index 5c92cb21dd..30a57b5c24 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -114,7 +114,7 @@ $link-hover-decoration: underline !default; // Grid breakpoints // -// Define the minimum and maximum dimensions at which your layout will change, +// Define the minimum dimensions at which your layout will change, // adapting to different screen sizes, for use in media queries. $grid-breakpoints: ( From 3b2f0523aab1906f018c19a741223f5c6fd98d4c Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 03:52:30 -0800 Subject: [PATCH 09/16] CONTRIBUTING: Document restriction regarding jQuery event alias methods Refs #19192 [ci skip] --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 122b1542a7..ab7b624c0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -235,6 +235,7 @@ includes code changes) and under the terms of the - 2 spaces (no tabs) - strict mode - "Attractive" +- Don't use [jQuery event alias convenience methods](https://github.com/jquery/jquery/blob/master/src/event/alias.js) (such as `$().focus()`). Instead, use [`$().trigger(eventType, ...)`](http://api.jquery.com/trigger/) or [`$().on(eventType, ...)`](http://api.jquery.com/on/), depending on whether you're firing an event or listening for an event. (For example, `$().trigger('focus')` or `$().on('focus', function (event) { /* handle focus event */ })`) We do this to be compatible with custom builds of jQuery where the event aliases module has been excluded. ### Checking coding style From ff4792fcefbe7369c95cf7b2d06e7d211b1c3991 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Tue, 16 Feb 2016 04:05:41 -0800 Subject: [PATCH 10/16] js/tests/index.html: Replace jQuery event alias methods with functions that throw explanatory errors, instead of with undefined Refs https://github.com/twbs/bootstrap/pull/19219#issuecomment-184653699 [skip validator] --- js/tests/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/tests/index.html b/js/tests/index.html index a91725cc5d..e4cbae42fe 100644 --- a/js/tests/index.html +++ b/js/tests/index.html @@ -44,7 +44,10 @@ 'undelegate' ] for (var i = 0; i < eventAliases.length; i++) { - $.fn[eventAliases[i]] = undefined + var eventAlias = eventAliases[i] + $.fn[eventAlias] = function () { + throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js') + } } })() From a496cb8be4dd1ccd4610e06f425153c76defc594 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Tue, 16 Feb 2016 14:16:27 +0000 Subject: [PATCH 11/16] Focus (visually hidden) input radio/checkbox This allows for keyboard navigation (e.g. arrow keys left/right to trigger different radio buttons) following an initial mouse click interaction --- js/src/button.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/button.js b/js/src/button.js index 3144a3f101..adcf4c9286 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -92,7 +92,10 @@ const Button = (($) => { input.checked = !$(this._element).hasClass(ClassName.ACTIVE) $(this._element).trigger('change') } + + $(input).trigger('focus') } + } else { this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)) From 87d248a482d4d5a83f71c31d3d45f529f4631a1d Mon Sep 17 00:00:00 2001 From: Jaga Santagostino Date: Tue, 16 Feb 2016 20:29:59 +0100 Subject: [PATCH 12/16] Fix typos in plural tag names --- docs/content/reboot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/reboot.md b/docs/content/reboot.md index 73ea411719..de3f47a9fd 100644 --- a/docs/content/reboot.md +++ b/docs/content/reboot.md @@ -193,7 +193,7 @@ Various form elements have been rebooted for simpler base styles. Here are some - `
`s have no borders, padding, or margin so they can be easily used as wrappers for individual inputs or groups of inputs. - ``s, like fieldsets, have also been restyled to be displayed as a heading of sorts. - `