// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix // Reboot // // Normalization of HTML elements, manually forked from Normalize.css to remove // styles targeting irrelevant browsers while applying new styles. // // Normalize is licensed MIT. https://github.com/necolas/normalize.css // Document // // Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`. *, *::before, *::after { box-sizing: border-box; } // Root // // Ability to the value of the root font sizes, affecting the value of `rem`. // null by default, thus nothing is generated. :root { font-size: $font-size-root; } // Body // // 1. Remove the margin in all browsers. // 2. As a best practice, apply a default `background-color`. // 3. Prevent adjustments of font size after orientation changes in iOS. // 4. Change the default tap highlight to be completely transparent in iOS. body { margin: 0; // 1 font-family: $font-family-base; @include font-size($font-size-base); font-weight: $font-weight-base; line-height: $line-height-base; color: $body-color; text-align: $body-text-align; background-color: $body-bg; // 2 -webkit-text-size-adjust: 100%; // 3 -webkit-tap-highlight-color: rgba($black, 0); // 4 } // 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 // 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, // or the browser has somehow determined that the user is primarily a keyboard user and/or // wants focus outlines to always be presented. // 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/ [tabindex="-1"]:focus:not(:focus-visible) { outline: 0 !important; } // Content grouping // // 1. Reset Firefox's gray color // 2. Set correct height and prevent the `size` attribute to make the `hr` look like an input field // See https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_hr_size hr { margin: $hr-margin-y 0; color: $hr-color; // 1 background-color: currentColor; border: 0; opacity: $hr-opacity; } hr:not([size]) { height: $hr-height; // 2 } // Typography // // 1. Remove top margins from headings // By default, `
`s get reset. However, we also reset the // bottom margin to use `rem` units instead of `em`. p { margin-top: 0; margin-bottom: $paragraph-margin-bottom; } // Abbreviations // // 1. Duplicate behavior to the data-* attribute for our tooltip plugin // 2. Add the correct text decoration in Chrome, Edge, Opera, and Safari. // 3. Add explicit cursor to indicate changed behavior. // 4. Prevent the text-decoration to be skipped. abbr[title], abbr[data-original-title] { // 1 text-decoration: underline; // 2 text-decoration: underline dotted; // 2 cursor: help; // 3 text-decoration-skip-ink: none; // 4 } // Address address { margin-bottom: 1rem; font-style: normal; line-height: inherit; } // Lists ol, ul { padding-left: 2rem; } ol, ul, dl { margin-top: 0; margin-bottom: 1rem; } ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; } dt { font-weight: $dt-font-weight; } // 1. Undo browser default dd { margin-bottom: .5rem; margin-left: 0; // 1 } // Blockquote blockquote { margin: 0 0 1rem; } // Strong // // Add the correct font weight in Chrome, Edge, and Safari b, strong { font-weight: $font-weight-bolder; } // Small // // Add the correct font size in all browsers small { @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 // all browsers. sub, sup { position: relative; @include font-size($sub-sup-font-size); line-height: 0; vertical-align: baseline; } sub { bottom: -.25em; } sup { top: -.5em; } // Links a { color: $link-color; text-decoration: $link-decoration; &:hover { color: $link-hover-color; text-decoration: $link-hover-decoration; } } // And undo these styles for placeholder links/named anchors (without href). // It would be more straightforward to just use a[href] in previous block, but that // causes specificity issues in many other styles that are too complex to fix. // See https://github.com/twbs/bootstrap/issues/19402 a:not([href]):not([class]) { &, &:hover { color: inherit; text-decoration: none; } } // Code pre, code, kbd, samp { font-family: $font-family-code; @include font-size(1em); // Correct the odd `em` font sizing in all browsers. } // 1. Remove browser default top margin // 2. Reset browser default of `1em` to use `rem`s // 3. Don't allow content to break outside // 4. Disable auto-hiding scrollbar in legacy Edge to avoid overlap, // making it impossible to interact with the content pre { display: block; margin-top: 0; // 1 margin-bottom: 1rem; // 2 overflow: auto; // 3 @include font-size($code-font-size); color: $pre-color; -ms-overflow-style: scrollbar; // 4 // Account for some code outputs that place code tags in pre tags code { @include font-size(inherit); color: inherit; word-break: normal; } } code { @include font-size($code-font-size); color: $code-color; word-wrap: break-word; // Streamline the style when inside anchors to avoid broken underline and more a > & { color: inherit; } } kbd { padding: $kbd-padding-y $kbd-padding-x; @include font-size($kbd-font-size); color: $kbd-color; background-color: $kbd-bg; @include border-radius($border-radius-sm); kbd { padding: 0; @include font-size(1em); font-weight: $nested-kbd-font-weight; } } // Figures // // Apply a consistent margin strategy (matches our type styles). figure { margin: 0 0 1rem; } // Images and content img, svg { vertical-align: middle; } // Tables // // Prevent double borders table { caption-side: bottom; border-collapse: collapse; } caption { padding-top: $table-cell-padding-y; padding-bottom: $table-cell-padding-y; color: $table-caption-color; text-align: left; } // 1. Matches default `