1 // scss-lint:disable QualifyingElement, DuplicateProperty
5 // Global resets to common HTML elements and more for easier usage by Bootstrap.
6 // Adds additional rules on top of Normalize.css, including several overrides.
9 // Reset the box-sizing
11 // Change from `box-sizing: content-box` to `border-box` so that when you add
12 // `padding` or `border`s to an element, the overall declared `width` does not
13 // change. For example, `width: 100px;` will always be `100px` despite the
14 // `border: 10px solid red;` and `padding: 20px;`.
16 // Heads up! This reset may cause conflicts with some third-party widgets. For
17 // recommendations on resolving such conflicts, see
18 // https://getbootstrap.com/getting-started/#third-box-sizing.
20 // Credit: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
23 box-sizing: border-box;
33 // Make viewport responsive
35 // @viewport is needed because IE 10+ doesn't honor <meta name="viewport"> in
36 // some cases. See https://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/.
37 // Eventually @viewport will replace <meta name="viewport">.
39 // However, `device-width` is broken on IE 10 on Windows (Phone) 8,
40 // (see https://timkadlec.com/2013/01/windows-phone-8-and-device-width/ and https://github.com/twbs/bootstrap/issues/10497)
41 // and the fix for that involves a snippet of JavaScript to sniff the user agent
42 // and apply some conditional CSS.
44 // See https://getbootstrap.com/getting-started/#support-ie10-width for the relevant hack.
46 // Wrap `@viewport` with `@at-root` for when folks do a nested import (e.g.,
47 // `.class-name { @import "bootstrap"; }`).
49 @-ms-viewport { width: device-width; }
54 // Reset HTML, body, and more
58 // We assume no initial pixel `font-size` for accessibility reasons. This
59 // allows web visitors to customize their browser default font-size, making
60 // your project more inclusive and accessible to everyone.
62 // As a side-effect of setting the @viewport above,
63 // IE11 & Edge make the scrollbar overlap the content and automatically hide itself when not in use.
64 // Unfortunately, the auto-showing of the scrollbar is sometimes too sensitive,
65 // thus making it hard to click on stuff near the right edge of the page.
66 // So we add this style to force IE11 & Edge to use a "normal", non-overlapping, non-auto-hiding scrollbar.
67 // See https://github.com/twbs/bootstrap/issues/18543
68 // and https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7165383/
69 -ms-overflow-style: scrollbar;
71 // Changes the default tap highlight to be completely transparent in iOS.
72 -webkit-tap-highlight-color: rgba(0,0,0,0);
76 font-family: $font-family-base;
77 font-size: $font-size-base;
78 font-weight: $font-weight-base;
79 line-height: $line-height-base;
80 // Go easy on the eyes and use something other than `#000` for text
82 // By default, `<body>` has no `background-color` so we set one as a best practice.
83 background-color: $body-bg;
86 // Suppress the focus outline on elements that cannot be accessed via keyboard.
87 // This prevents an unwanted focus outline from appearing around elements that
88 // might still respond to pointer events.
90 // Credit: https://github.com/suitcss/base
91 [tabindex="-1"]:focus {
92 outline: none !important;
100 // Remove top margins from headings
102 // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
103 // margin for easier control within type scales as it avoids margin collapsing.
104 h1, h2, h3, h4, h5, h6 {
106 margin-bottom: .5rem;
109 // Reset margins on paragraphs
111 // Similarly, the top margin on `<p>`s get reset. However, we also reset the
112 // bottom margin to use `rem` units instead of `em`.
120 // Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257
121 abbr[data-original-title] {
128 line-height: inherit;
146 font-weight: $dt-font-weight;
150 margin-bottom: .5rem;
151 margin-left: 0; // Undo browser default
165 text-decoration: $link-decoration;
167 @include hover-focus {
168 color: $link-hover-color;
169 text-decoration: $link-hover-decoration;
173 // And undo these styles for placeholder links/named anchors (without href)
174 // which have not been made explicitly keyboard-focusable (without tabindex).
175 // It would be more straightforward to just use a[href] in previous block, but that
176 // causes specificity issues in many other styles that are too complex to fix.
177 // See https://github.com/twbs/bootstrap/issues/19402
179 a:not([href]):not([tabindex]) {
181 text-decoration: none;
183 @include hover-focus {
185 text-decoration: none;
199 // Remove browser default top margin
201 // Reset browser default of `1em` to use `rem`s
203 // Normalize v4 removed this property, causing `<pre>` content to break out of wrapping code snippets
213 // Normalize adds `margin` to `figure`s as browsers apply it inconsistently.
214 // We reset that to create a better flow in-page.
224 // By default, `<img>`s are `inline-block`. This assumes that, and vertically
225 // centers them. This won't apply should you reset them to `block` level.
226 vertical-align: middle;
227 // Note: `<img>`s are deliberately not made responsive by default.
228 // For the rationale behind this, see the comments on the `.img-fluid` class.
232 // iOS "clickable elements" fix for role="button"
234 // Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
235 // for traditionally non-focusable elements with role="button"
236 // see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
243 // Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.
245 // In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11
246 // DON'T remove the click delay when `<meta name="viewport" content="width=device-width">` is present.
247 // However, they DO support removing the click delay via `touch-action: manipulation`.
249 // * https://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch
250 // * http://caniuse.com/#feat=css-touch-action
251 // * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay
262 touch-action: manipulation;
271 // No longer part of Normalize since v4
272 border-collapse: collapse;
273 // Reset for nesting within parents with `background-color`.
274 background-color: $table-bg;
278 padding-top: $table-cell-padding;
279 padding-bottom: $table-cell-padding;
282 caption-side: bottom;
286 // Centered by default, but left-align-ed to match the `td`s below.
296 // Allow labels to use `margin` for spacing.
297 display: inline-block;
298 margin-bottom: .5rem;
301 // Work around a Firefox/IE bug where the transparent `button` background
302 // results in a loss of the default `button` focus styles.
304 // Credit: https://github.com/suitcss/base/
307 outline: 5px auto -webkit-focus-ring-color;
314 // Normalize includes `font: inherit;`, so `font-family`. `font-size`, etc are
315 // properly inherited. However, `line-height` isn't inherited there.
316 line-height: inherit;
320 input[type="checkbox"] {
321 // Apply a disabled cursor for radios and checkboxes.
323 // Note: Neither radios nor checkboxes can be readonly.
325 cursor: $cursor-disabled;
332 input[type="datetime-local"],
333 input[type="month"] {
334 // Remove the default appearance of temporal inputs to avoid a Mobile Safari
335 // bug where setting a custom line-height prevents text from being vertically
336 // centered within the input.
337 // See https://bugs.webkit.org/show_bug.cgi?id=139848
338 // and https://github.com/twbs/bootstrap/issues/11266
339 -webkit-appearance: listbox;
343 // Textareas should really only resize vertically so they don't break their (horizontal) containers.
348 // Browsers set a default `min-width: min-content;` on fieldsets,
349 // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
350 // So we reset that to ensure fieldsets behave more like a standard block element.
351 // See https://github.com/twbs/bootstrap/issues/12359
352 // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
354 // Reset the default outline behavior of fieldsets so they don't affect page layout.
361 // Reset the entire legend element to match the `fieldset`
365 margin-bottom: .5rem;
367 line-height: inherit;
370 input[type="search"] {
371 // This overrides the extra rounded corners on search inputs in iOS so that our
372 // `.form-control` class can properly style them. Note that this cannot simply
373 // be added to `.form-control` as it's not specific enough. For details, see
374 // https://github.com/twbs/bootstrap/issues/11586.
375 -webkit-appearance: none;
380 display: inline-block;
381 // font-size: $font-size-base;
382 // line-height: $line-height;
383 // color: $input-color;
386 // Always hide an element with the `hidden` HTML attribute (from PureCSS).
388 display: none !important;