1 // stylelint-disable declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
6 // Normalization of HTML elements, manually forked from Normalize.css to remove
7 // styles targeting irrelevant browsers while applying new styles.
9 // Normalize is licensed MIT. https://github.com/necolas/normalize.css
14 // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
19 box-sizing: border-box;
25 // Ability to the value of the root font sizes, affecting the value of `rem`.
26 // null by default, thus nothing is generated.
29 @if $font-size-root != null {
30 @include font-size(var(--#{$prefix}root-font-size));
33 @if $enable-smooth-scroll {
34 @media (prefers-reduced-motion: no-preference) {
35 scroll-behavior: smooth;
43 // 1. Remove the margin in all browsers.
44 // 2. As a best practice, apply a default `background-color`.
45 // 3. Prevent adjustments of font size after orientation changes in iOS.
46 // 4. Change the default tap highlight to be completely transparent in iOS.
48 // scss-docs-start reboot-body-rules
51 font-family: var(--#{$prefix}body-font-family);
52 @include font-size(var(--#{$prefix}body-font-size));
53 font-weight: var(--#{$prefix}body-font-weight);
54 line-height: var(--#{$prefix}body-line-height);
55 color: var(--#{$prefix}body-color);
56 text-align: var(--#{$prefix}body-text-align);
57 background-color: var(--#{$prefix}body-bg); // 2
58 -webkit-text-size-adjust: 100%; // 3
59 -webkit-tap-highlight-color: rgba($black, 0); // 4
61 // scss-docs-end reboot-body-rules
66 // 1. Reset Firefox's gray color
69 margin: $hr-margin-y 0;
70 color: $hr-color; // 1
72 border-top: $hr-border-width solid $hr-border-color;
79 // 1. Remove top margins from headings
80 // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
81 // margin for easier control within type scales as it avoids margin collapsing.
85 margin-bottom: $headings-margin-bottom;
86 font-family: $headings-font-family;
87 font-style: $headings-font-style;
88 font-weight: $headings-font-weight;
89 line-height: $headings-line-height;
90 color: $headings-color;
95 @include font-size($h1-font-size);
100 @include font-size($h2-font-size);
105 @include font-size($h3-font-size);
110 @include font-size($h4-font-size);
115 @include font-size($h5-font-size);
120 @include font-size($h6-font-size);
124 // Reset margins on paragraphs
126 // Similarly, the top margin on `<p>`s get reset. However, we also reset the
127 // bottom margin to use `rem` units instead of `em`.
131 margin-bottom: $paragraph-margin-bottom;
137 // 1. Add the correct text decoration in Chrome, Edge, Opera, and Safari.
138 // 2. Add explicit cursor to indicate changed behavior.
139 // 3. Prevent the text-decoration to be skipped.
142 text-decoration: underline dotted; // 1
144 text-decoration-skip-ink: none; // 3
153 line-height: inherit;
179 font-weight: $dt-font-weight;
182 // 1. Undo browser default
185 margin-bottom: .5rem;
199 // Add the correct font weight in Chrome, Edge, and Safari
203 font-weight: $font-weight-bolder;
209 // Add the correct font size in all browsers
212 @include font-size($small-font-size);
219 padding: $mark-padding;
220 background-color: var(--#{$prefix}highlight-bg);
226 // Prevent `sub` and `sup` elements from affecting the line height in
232 @include font-size($sub-sup-font-size);
234 vertical-align: baseline;
237 sub { bottom: -.25em; }
244 color: var(--#{$prefix}link-color);
245 text-decoration: $link-decoration;
248 color: var(--#{$prefix}link-hover-color);
249 text-decoration: $link-hover-decoration;
253 // And undo these styles for placeholder links/named anchors (without href).
254 // It would be more straightforward to just use a[href] in previous block, but that
255 // causes specificity issues in many other styles that are too complex to fix.
256 // See https://github.com/twbs/bootstrap/issues/19402
258 a:not([href]):not([class]) {
262 text-decoration: none;
273 font-family: $font-family-code;
274 @include font-size(1em); // Correct the odd `em` font sizing in all browsers.
277 // 1. Remove browser default top margin
278 // 2. Reset browser default of `1em` to use `rem`s
279 // 3. Don't allow content to break outside
284 margin-bottom: 1rem; // 2
286 @include font-size($code-font-size);
289 // Account for some code outputs that place code tags in pre tags
291 @include font-size(inherit);
298 @include font-size($code-font-size);
299 color: var(--#{$prefix}code-color);
300 word-wrap: break-word;
302 // Streamline the style when inside anchors to avoid broken underline and more
309 padding: $kbd-padding-y $kbd-padding-x;
310 @include font-size($kbd-font-size);
312 background-color: $kbd-bg;
313 @include border-radius($border-radius-sm);
317 @include font-size(1em);
318 font-weight: $nested-kbd-font-weight;
325 // Apply a consistent margin strategy (matches our type styles).
332 // Images and content
336 vertical-align: middle;
342 // Prevent double borders
345 caption-side: bottom;
346 border-collapse: collapse;
350 padding-top: $table-cell-padding-y;
351 padding-bottom: $table-cell-padding-y;
352 color: $table-caption-color;
356 // 1. Removes font-weight bold by inheriting
357 // 2. Matches default `<td>` alignment by inheriting `text-align`.
358 // 3. Fix alignment for Safari
361 font-weight: $table-th-font-weight; // 1
362 text-align: inherit; // 2
363 text-align: -webkit-match-parent; // 3
372 border-color: inherit;
380 // 1. Allow labels to use `margin` for spacing.
383 display: inline-block; // 1
386 // Remove the default `border-radius` that macOS Chrome adds.
387 // See https://github.com/twbs/bootstrap/issues/24093
390 // stylelint-disable-next-line property-disallowed-list
394 // Explicitly remove focus outline in Chromium when it shouldn't be
395 // visible (e.g. as result of mouse click or touch tap). It already
396 // should be doing this automatically, but seems to currently be
397 // confused and applies its very visible two-tone outline anyway.
399 button:focus:not(:focus-visible) {
403 // 1. Remove the margin in Firefox and Safari
411 font-family: inherit;
412 @include font-size(inherit);
413 line-height: inherit;
416 // Remove the inheritance of text transform in Firefox
419 text-transform: none;
421 // Set the cursor for non-`<button>` buttons
423 // Details at https://github.com/twbs/bootstrap/pull/30562
429 // Remove the inheritance of word-wrap in Safari.
430 // See https://github.com/twbs/bootstrap/issues/24990
433 // Undo the opacity change from Chrome
439 // Remove the dropdown arrow only from text type inputs built with datalists in Chrome.
440 // See https://stackoverflow.com/a/54997118
442 [list]:not([type="date"]):not([type="datetime-local"]):not([type="month"]):not([type="week"]):not([type="time"])::-webkit-calendar-picker-indicator {
443 display: none !important;
446 // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
447 // controls in Android 4.
448 // 2. Correct the inability to style clickable types in iOS and Safari.
449 // 3. Opinionated: add "hand" cursor to non-disabled button elements.
452 [type="button"], // 1
455 -webkit-appearance: button; // 2
457 @if $enable-button-pointers {
459 cursor: pointer; // 3
464 // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
471 // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
474 resize: vertical; // 1
477 // 1. Browsers set a default `min-width: min-content;` on fieldsets,
478 // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
479 // So we reset that to ensure fieldsets behave more like a standard block element.
480 // See https://github.com/twbs/bootstrap/issues/12359
481 // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
482 // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
491 // 1. By using `float: left`, the legend will behave like a block element.
492 // This way the border of a fieldset wraps around the legend if present.
493 // 2. Fix wrapping bug.
494 // See https://github.com/twbs/bootstrap/issues/29712
500 margin-bottom: $legend-margin-bottom;
501 @include font-size($legend-font-size);
502 font-weight: $legend-font-weight;
503 line-height: inherit;
510 // Fix height of inputs with a type of datetime-local, date, month, week, or time
511 // See https://github.com/twbs/bootstrap/issues/18842
513 ::-webkit-datetime-edit-fields-wrapper,
514 ::-webkit-datetime-edit-text,
515 ::-webkit-datetime-edit-minute,
516 ::-webkit-datetime-edit-hour-field,
517 ::-webkit-datetime-edit-day-field,
518 ::-webkit-datetime-edit-month-field,
519 ::-webkit-datetime-edit-year-field {
523 ::-webkit-inner-spin-button {
527 // 1. Correct the outline style in Safari.
528 // 2. This overrides the extra rounded corners on search inputs in iOS so that our
529 // `.form-control` class can properly style them. Note that this cannot simply
530 // be added to `.form-control` as it's not specific enough. For details, see
531 // https://github.com/twbs/bootstrap/issues/11586.
534 outline-offset: -2px; // 1
535 -webkit-appearance: textfield; // 2
538 // 1. A few input types should stay LTR
539 // See https://rtlstyling.com/posts/rtl-styling#form-inputs
540 // 2. RTL only output
541 // See https://rtlcss.com/learn/usage-guide/control-directives/#raw
552 // Remove the inner padding in Chrome and Safari on macOS.
554 ::-webkit-search-decoration {
555 -webkit-appearance: none;
558 // Remove padding around color pickers in webkit browsers
560 ::-webkit-color-swatch-wrapper {
565 // 1. Inherit font family and line height for file input buttons
566 // 2. Correct the inability to style clickable types in iOS and Safari.
568 ::file-selector-button {
570 -webkit-appearance: button; // 2
573 // Correct element displays
576 display: inline-block;
579 // Remove border from iframe
587 // 1. Add the correct display in all browsers
590 display: list-item; // 1
597 // Add the correct vertical alignment in Chrome, Firefox, and Opera.
600 vertical-align: baseline;
606 // Always hide an element with the `hidden` HTML attribute.
609 display: none !important;