mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-21 18:54:30 +01:00
reboot file: adds some grouping and comments standardizations (#30340)
* style: groups sections - adds two nl before any section - extract elements from wrong section ex: `mark` from `form` * style: format comments * style: sticks all `see`s with the description - sticks - renames * style: removes not needed spaces * style: removes not needed number like other cases * style: stick credits with description * style: adds missing number
This commit is contained in:
parent
7eaf7528fc
commit
59c5d7599d
@ -1,5 +1,6 @@
|
|||||||
// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
|
// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
|
||||||
|
|
||||||
|
|
||||||
// Reboot
|
// Reboot
|
||||||
//
|
//
|
||||||
// Normalization of HTML elements, manually forked from Normalize.css to remove
|
// Normalization of HTML elements, manually forked from Normalize.css to remove
|
||||||
@ -11,27 +12,31 @@
|
|||||||
// Document
|
// Document
|
||||||
//
|
//
|
||||||
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
|
// Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*::before,
|
*::before,
|
||||||
*::after {
|
*::after {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Root
|
// Root
|
||||||
//
|
//
|
||||||
// 1. Ability to the value of the root font sizes, affecting the value of `rem`.
|
// Ability to the value of the root font sizes, affecting the value of `rem`.
|
||||||
// null by default, thus nothing is generated.
|
// null by default, thus nothing is generated.
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
font-size: $font-size-root; // 1
|
font-size: $font-size-root;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Body
|
// Body
|
||||||
//
|
//
|
||||||
// 1. Remove the margin in all browsers.
|
// 1. Remove the margin in all browsers.
|
||||||
// 2. As a best practice, apply a default `background-color`.
|
// 2. As a best practice, apply a default `background-color`.
|
||||||
// 3. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
|
// 3. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
|
||||||
// 4. Change the default tap highlight to be completely transparent in iOS.
|
// 4. Change the default tap highlight to be completely transparent in iOS.
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0; // 1
|
margin: 0; // 1
|
||||||
font-family: $font-family-base;
|
font-family: $font-family-base;
|
||||||
@ -45,13 +50,13 @@ body {
|
|||||||
-webkit-tap-highlight-color: rgba($black, 0); // 4
|
-webkit-tap-highlight-color: rgba($black, 0); // 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Future-proof rule: in browsers that support :focus-visible, suppress the focus outline
|
// Future-proof rule: in browsers that support :focus-visible, suppress the focus outline
|
||||||
// on elements that programmatically receive focus but wouldn't normally show a visible
|
// on elements that programmatically receive focus but wouldn't normally show a visible
|
||||||
// focus outline. In general, this would mean that the outline is only applied if the
|
// focus outline. In general, this would mean that the outline is only applied if the
|
||||||
// interaction that led to the element receiving programmatic focus was a keyboard interaction,
|
// interaction that led to the element receiving programmatic focus was a keyboard interaction,
|
||||||
// or the browser has somehow determined that the user is primarily a keyboard user and/or
|
// or the browser has somehow determined that the user is primarily a keyboard user and/or
|
||||||
// wants focus outlines to always be presented.
|
// wants focus outlines to always be presented.
|
||||||
//
|
|
||||||
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
|
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
|
||||||
// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/
|
// and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/
|
||||||
|
|
||||||
@ -153,12 +158,17 @@ abbr[data-original-title] { // 1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Address
|
||||||
|
|
||||||
address {
|
address {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Lists
|
||||||
|
|
||||||
ol,
|
ol,
|
||||||
ul {
|
ul {
|
||||||
padding-left: 2rem;
|
padding-left: 2rem;
|
||||||
@ -189,10 +199,16 @@ dd {
|
|||||||
margin-left: 0; // 1
|
margin-left: 0; // 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Blockquote
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
margin: 0 0 1rem;
|
margin: 0 0 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Strong
|
||||||
|
//
|
||||||
// Add the correct font weight in Chrome, Edge, and Safari
|
// Add the correct font weight in Chrome, Edge, and Safari
|
||||||
|
|
||||||
b,
|
b,
|
||||||
@ -201,12 +217,25 @@ strong {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Small
|
||||||
|
//
|
||||||
// Add the correct font size in all browsers
|
// Add the correct font size in all browsers
|
||||||
|
|
||||||
small {
|
small {
|
||||||
@include font-size($small-font-size);
|
@include font-size($small-font-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mark
|
||||||
|
|
||||||
|
mark {
|
||||||
|
padding: $mark-padding;
|
||||||
|
background-color: $mark-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Sub and Sup
|
||||||
|
//
|
||||||
// Prevent `sub` and `sup` elements from affecting the line height in
|
// Prevent `sub` and `sup` elements from affecting the line height in
|
||||||
// all browsers.
|
// all browsers.
|
||||||
|
|
||||||
@ -305,7 +334,7 @@ kbd {
|
|||||||
|
|
||||||
|
|
||||||
// Figures
|
// Figures
|
||||||
|
//
|
||||||
// Apply a consistent margin strategy (matches our type styles).
|
// Apply a consistent margin strategy (matches our type styles).
|
||||||
|
|
||||||
figure {
|
figure {
|
||||||
@ -329,7 +358,7 @@ svg {
|
|||||||
|
|
||||||
|
|
||||||
// Tables
|
// Tables
|
||||||
|
//
|
||||||
// Prevent double borders
|
// Prevent double borders
|
||||||
|
|
||||||
table {
|
table {
|
||||||
@ -344,17 +373,17 @@ caption {
|
|||||||
caption-side: bottom;
|
caption-side: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Matches default `<td>` alignment by inheriting `text-align`.
|
// 1. Matches default `<td>` alignment by inheriting `text-align`.
|
||||||
// 1. Fix alignment for Safari
|
// 2. Fix alignment for Safari
|
||||||
|
|
||||||
th {
|
th {
|
||||||
text-align: inherit;
|
text-align: inherit; // 1
|
||||||
text-align: -webkit-match-parent; // 1
|
text-align: -webkit-match-parent; // 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Forms
|
// Forms
|
||||||
|
//
|
||||||
// 1. Allow labels to use `margin` for spacing.
|
// 1. Allow labels to use `margin` for spacing.
|
||||||
|
|
||||||
label {
|
label {
|
||||||
@ -363,8 +392,7 @@ label {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the default `border-radius` that macOS Chrome adds.
|
// Remove the default `border-radius` that macOS Chrome adds.
|
||||||
//
|
// See https://github.com/twbs/bootstrap/issues/24093
|
||||||
// Details at https://github.com/twbs/bootstrap/issues/24093
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
// stylelint-disable-next-line property-blacklist
|
// stylelint-disable-next-line property-blacklist
|
||||||
@ -373,8 +401,7 @@ button {
|
|||||||
|
|
||||||
// Work around a Firefox/IE bug where the transparent `button` background
|
// Work around a Firefox/IE bug where the transparent `button` background
|
||||||
// results in a loss of the default `button` focus styles.
|
// results in a loss of the default `button` focus styles.
|
||||||
//
|
// Credit https://github.com/suitcss/base/
|
||||||
// Credit: https://github.com/suitcss/base/
|
|
||||||
|
|
||||||
button:focus {
|
button:focus {
|
||||||
outline: 1px dotted;
|
outline: 1px dotted;
|
||||||
@ -388,7 +415,7 @@ button,
|
|||||||
select,
|
select,
|
||||||
optgroup,
|
optgroup,
|
||||||
textarea {
|
textarea {
|
||||||
margin: 0;
|
margin: 0; // 1
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
@include font-size(inherit);
|
@include font-size(inherit);
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
@ -409,16 +436,14 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the inheritance of word-wrap in Safari.
|
// Remove the inheritance of word-wrap in Safari.
|
||||||
//
|
// See https://github.com/twbs/bootstrap/issues/24990
|
||||||
// Details at https://github.com/twbs/bootstrap/issues/24990
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the dropdown arrow in Chrome from inputs built with datalists.
|
// Remove the dropdown arrow in Chrome from inputs built with datalists.
|
||||||
//
|
// See https://stackoverflow.com/a/54997118
|
||||||
// Source: https://stackoverflow.com/a/54997118
|
|
||||||
|
|
||||||
[list]::-webkit-calendar-picker-indicator {
|
[list]::-webkit-calendar-picker-indicator {
|
||||||
display: none;
|
display: none;
|
||||||
@ -442,7 +467,6 @@ button,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
|
// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
|
||||||
|
|
||||||
::-moz-focus-inner {
|
::-moz-focus-inner {
|
||||||
@ -450,7 +474,6 @@ button,
|
|||||||
border-style: none;
|
border-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Remove the default appearance of temporal inputs to avoid a Mobile Safari
|
// Remove the default appearance of temporal inputs to avoid a Mobile Safari
|
||||||
// bug where setting a custom line-height prevents text from being vertically
|
// bug where setting a custom line-height prevents text from being vertically
|
||||||
// centered within the input.
|
// centered within the input.
|
||||||
@ -486,7 +509,6 @@ fieldset {
|
|||||||
border: 0; // 2
|
border: 0; // 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 1. By using `float: left`, the legend will behave like a block element
|
// 1. By using `float: left`, the legend will behave like a block element
|
||||||
// 2. Correct the color inheritance from `fieldset` elements in IE.
|
// 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||||
// 3. Correct the text wrapping in Edge and IE.
|
// 3. Correct the text wrapping in Edge and IE.
|
||||||
@ -503,19 +525,6 @@ legend {
|
|||||||
white-space: normal; // 3
|
white-space: normal; // 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mark {
|
|
||||||
padding: $mark-padding;
|
|
||||||
background-color: $mark-bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
||||||
|
|
||||||
progress {
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Fix height of inputs with a type of datetime-local, date, month, week, or time
|
// Fix height of inputs with a type of datetime-local, date, month, week, or time
|
||||||
// See https://github.com/twbs/bootstrap/issues/18842
|
// See https://github.com/twbs/bootstrap/issues/18842
|
||||||
|
|
||||||
@ -524,7 +533,6 @@ progress {
|
|||||||
line-height: 0;
|
line-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 1. Correct the outline style in Safari.
|
// 1. Correct the outline style in Safari.
|
||||||
// 2. This overrides the extra rounded corners on search inputs in iOS so that our
|
// 2. This overrides the extra rounded corners on search inputs in iOS so that our
|
||||||
// `.form-control` class can properly style them. Note that this cannot simply
|
// `.form-control` class can properly style them. Note that this cannot simply
|
||||||
@ -562,6 +570,9 @@ output {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Summary
|
||||||
|
//
|
||||||
// 1. Add the correct display in all browsers
|
// 1. Add the correct display in all browsers
|
||||||
|
|
||||||
summary {
|
summary {
|
||||||
@ -569,16 +580,34 @@ summary {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Template
|
||||||
|
//
|
||||||
// Add the correct display for template & main in IE 11
|
// Add the correct display for template & main in IE 11
|
||||||
|
|
||||||
template {
|
template {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Main
|
||||||
|
|
||||||
main {
|
main {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Progress
|
||||||
|
//
|
||||||
|
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||||
|
|
||||||
|
progress {
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Hidden attribute
|
||||||
|
//
|
||||||
// Always hide an element with the `hidden` HTML attribute.
|
// Always hide an element with the `hidden` HTML attribute.
|
||||||
|
|
||||||
[hidden] {
|
[hidden] {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user