roojs-all.js
[roojs1] / scss / bootstrap / _reboot.scss
1 // stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
2
3 // Reboot
4 //
5 // Normalization of HTML elements, manually forked from Normalize.css to remove
6 // styles targeting irrelevant browsers while applying new styles.
7 //
8 // Normalize is licensed MIT. https://github.com/necolas/normalize.css
9
10
11 // Document
12 //
13 // 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
14 // 2. Change the default font family in all browsers.
15 // 3. Correct the line height in all browsers.
16 // 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
17 // 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so
18 //    we force a non-overlapping, non-auto-hiding scrollbar to counteract.
19 // 6. Change the default tap highlight to be completely transparent in iOS.
20
21 *,
22 *::before,
23 *::after {
24   box-sizing: border-box; // 1
25 }
26
27 html {
28   font-family: sans-serif; // 2
29   line-height: 1.15; // 3
30   -webkit-text-size-adjust: 100%; // 4
31   -ms-overflow-style: scrollbar; // 5
32   -webkit-tap-highlight-color: rgba($black, 0); // 6
33 }
34
35 // IE10+ doesn't honor `<meta name="viewport">` in some cases.
36 @at-root {
37   @-ms-viewport {
38     width: device-width;
39   }
40 }
41
42 // Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
43 // TODO: remove in v5
44 // stylelint-disable-next-line selector-list-comma-newline-after
45 article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
46   display: block;
47 }
48
49 // Body
50 //
51 // 1. Remove the margin in all browsers.
52 // 2. As a best practice, apply a default `background-color`.
53 // 3. Set an explicit initial text-align value so that we can later use the
54 //    the `inherit` value on things like `<th>` elements.
55
56 body {
57   margin: 0; // 1
58   font-family: $font-family-base;
59   font-size: $font-size-base;
60   font-weight: $font-weight-base;
61   line-height: $line-height-base;
62   color: $body-color;
63   text-align: left; // 3
64   background-color: $body-bg; // 2
65 }
66
67 // Suppress the focus outline on elements that cannot be accessed via keyboard.
68 // This prevents an unwanted focus outline from appearing around elements that
69 // might still respond to pointer events.
70 //
71 // Credit: https://github.com/suitcss/base
72 [tabindex="-1"]:focus {
73   outline: 0 !important;
74 }
75
76
77 // Content grouping
78 //
79 // 1. Add the correct box sizing in Firefox.
80 // 2. Show the overflow in Edge and IE.
81
82 hr {
83   box-sizing: content-box; // 1
84   height: 0; // 1
85   overflow: visible; // 2
86 }
87
88
89 //
90 // Typography
91 //
92
93 // Remove top margins from headings
94 //
95 // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
96 // margin for easier control within type scales as it avoids margin collapsing.
97 // stylelint-disable-next-line selector-list-comma-newline-after
98 h1, h2, h3, h4, h5, h6 {
99   margin-top: 0;
100   margin-bottom: $headings-margin-bottom;
101 }
102
103 // Reset margins on paragraphs
104 //
105 // Similarly, the top margin on `<p>`s get reset. However, we also reset the
106 // bottom margin to use `rem` units instead of `em`.
107 p {
108   margin-top: 0;
109   margin-bottom: $paragraph-margin-bottom;
110 }
111
112 // Abbreviations
113 //
114 // 1. Duplicate behavior to the data-* attribute for our tooltip plugin
115 // 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
116 // 3. Add explicit cursor to indicate changed behavior.
117 // 4. Remove the bottom border in Firefox 39-.
118 // 5. Prevent the text-decoration to be skipped.
119
120 abbr[title],
121 abbr[data-original-title] { // 1
122   text-decoration: underline; // 2
123   text-decoration: underline dotted; // 2
124   cursor: help; // 3
125   border-bottom: 0; // 4
126   text-decoration-skip-ink: none; // 5
127 }
128
129 address {
130   margin-bottom: 1rem;
131   font-style: normal;
132   line-height: inherit;
133 }
134
135 ol,
136 ul,
137 dl {
138   margin-top: 0;
139   margin-bottom: 1rem;
140 }
141
142 ol ol,
143 ul ul,
144 ol ul,
145 ul ol {
146   margin-bottom: 0;
147 }
148
149 dt {
150   font-weight: $dt-font-weight;
151 }
152
153 dd {
154   margin-bottom: .5rem;
155   margin-left: 0; // Undo browser default
156 }
157
158 blockquote {
159   margin: 0 0 1rem;
160 }
161
162 b,
163 strong {
164   font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari
165 }
166
167 small {
168   font-size: 80%; // Add the correct font size in all browsers
169 }
170
171 //
172 // Prevent `sub` and `sup` elements from affecting the line height in
173 // all browsers.
174 //
175
176 sub,
177 sup {
178   position: relative;
179   font-size: 75%;
180   line-height: 0;
181   vertical-align: baseline;
182 }
183
184 sub { bottom: -.25em; }
185 sup { top: -.5em; }
186
187
188 //
189 // Links
190 //
191
192 a {
193   color: $link-color;
194   text-decoration: $link-decoration;
195   background-color: transparent; // Remove the gray background on active links in IE 10.
196
197   @include hover {
198     color: $link-hover-color;
199     text-decoration: $link-hover-decoration;
200   }
201 }
202
203 // And undo these styles for placeholder links/named anchors (without href)
204 // which have not been made explicitly keyboard-focusable (without tabindex).
205 // It would be more straightforward to just use a[href] in previous block, but that
206 // causes specificity issues in many other styles that are too complex to fix.
207 // See https://github.com/twbs/bootstrap/issues/19402
208
209 a:not([href]):not([tabindex]) {
210   color: inherit;
211   text-decoration: none;
212
213   @include hover-focus {
214     color: inherit;
215     text-decoration: none;
216   }
217
218   &:focus {
219     outline: 0;
220   }
221 }
222
223
224 //
225 // Code
226 //
227
228 pre,
229 code,
230 kbd,
231 samp {
232   font-family: $font-family-monospace;
233   font-size: 1em; // Correct the odd `em` font sizing in all browsers.
234 }
235
236 pre {
237   // Remove browser default top margin
238   margin-top: 0;
239   // Reset browser default of `1em` to use `rem`s
240   margin-bottom: 1rem;
241   // Don't allow content to break outside
242   overflow: auto;
243   // We have @viewport set which causes scrollbars to overlap content in IE11 and Edge, so
244   // we force a non-overlapping, non-auto-hiding scrollbar to counteract.
245   -ms-overflow-style: scrollbar;
246 }
247
248
249 //
250 // Figures
251 //
252
253 figure {
254   // Apply a consistent margin strategy (matches our type styles).
255   margin: 0 0 1rem;
256 }
257
258
259 //
260 // Images and content
261 //
262
263 img {
264   vertical-align: middle;
265   border-style: none; // Remove the border on images inside links in IE 10-.
266 }
267
268 svg {
269   // Workaround for the SVG overflow bug in IE10/11 is still required.
270   // See https://github.com/twbs/bootstrap/issues/26878
271   overflow: hidden;
272   vertical-align: middle;
273 }
274
275
276 //
277 // Tables
278 //
279
280 table {
281   border-collapse: collapse; // Prevent double borders
282 }
283
284 caption {
285   padding-top: $table-cell-padding;
286   padding-bottom: $table-cell-padding;
287   color: $table-caption-color;
288   text-align: left;
289   caption-side: bottom;
290 }
291
292 th {
293   // Matches default `<td>` alignment by inheriting from the `<body>`, or the
294   // closest parent with a set `text-align`.
295   text-align: inherit;
296 }
297
298
299 //
300 // Forms
301 //
302
303 label {
304   // Allow labels to use `margin` for spacing.
305   display: inline-block;
306   margin-bottom: $label-margin-bottom;
307 }
308
309 // Remove the default `border-radius` that macOS Chrome adds.
310 //
311 // Details at https://github.com/twbs/bootstrap/issues/24093
312 button {
313   border-radius: 0;
314 }
315
316 // Work around a Firefox/IE bug where the transparent `button` background
317 // results in a loss of the default `button` focus styles.
318 //
319 // Credit: https://github.com/suitcss/base/
320 button:focus {
321   outline: 1px dotted;
322   outline: 5px auto -webkit-focus-ring-color;
323 }
324
325 input,
326 button,
327 select,
328 optgroup,
329 textarea {
330   margin: 0; // Remove the margin in Firefox and Safari
331   font-family: inherit;
332   font-size: inherit;
333   line-height: inherit;
334 }
335
336 button,
337 input {
338   overflow: visible; // Show the overflow in Edge
339 }
340
341 button,
342 select {
343   text-transform: none; // Remove the inheritance of text transform in Firefox
344 }
345
346 // 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
347 //    controls in Android 4.
348 // 2. Correct the inability to style clickable types in iOS and Safari.
349 button,
350 [type="button"], // 1
351 [type="reset"],
352 [type="submit"] {
353   -webkit-appearance: button; // 2
354 }
355
356 // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
357 button::-moz-focus-inner,
358 [type="button"]::-moz-focus-inner,
359 [type="reset"]::-moz-focus-inner,
360 [type="submit"]::-moz-focus-inner {
361   padding: 0;
362   border-style: none;
363 }
364
365 input[type="radio"],
366 input[type="checkbox"] {
367   box-sizing: border-box; // 1. Add the correct box sizing in IE 10-
368   padding: 0; // 2. Remove the padding in IE 10-
369 }
370
371
372 input[type="date"],
373 input[type="time"],
374 input[type="datetime-local"],
375 input[type="month"] {
376   // Remove the default appearance of temporal inputs to avoid a Mobile Safari
377   // bug where setting a custom line-height prevents text from being vertically
378   // centered within the input.
379   // See https://bugs.webkit.org/show_bug.cgi?id=139848
380   // and https://github.com/twbs/bootstrap/issues/11266
381   -webkit-appearance: listbox;
382 }
383
384 textarea {
385   overflow: auto; // Remove the default vertical scrollbar in IE.
386   // Textareas should really only resize vertically so they don't break their (horizontal) containers.
387   resize: vertical;
388 }
389
390 fieldset {
391   // Browsers set a default `min-width: min-content;` on fieldsets,
392   // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
393   // So we reset that to ensure fieldsets behave more like a standard block element.
394   // See https://github.com/twbs/bootstrap/issues/12359
395   // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
396   min-width: 0;
397   // Reset the default outline behavior of fieldsets so they don't affect page layout.
398   padding: 0;
399   margin: 0;
400   border: 0;
401 }
402
403 // 1. Correct the text wrapping in Edge and IE.
404 // 2. Correct the color inheritance from `fieldset` elements in IE.
405 legend {
406   display: block;
407   width: 100%;
408   max-width: 100%; // 1
409   padding: 0;
410   margin-bottom: .5rem;
411   font-size: 1.5rem;
412   line-height: inherit;
413   color: inherit; // 2
414   white-space: normal; // 1
415 }
416
417 progress {
418   vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.
419 }
420
421 // Correct the cursor style of increment and decrement buttons in Chrome.
422 [type="number"]::-webkit-inner-spin-button,
423 [type="number"]::-webkit-outer-spin-button {
424   height: auto;
425 }
426
427 [type="search"] {
428   // This overrides the extra rounded corners on search inputs in iOS so that our
429   // `.form-control` class can properly style them. Note that this cannot simply
430   // be added to `.form-control` as it's not specific enough. For details, see
431   // https://github.com/twbs/bootstrap/issues/11586.
432   outline-offset: -2px; // 2. Correct the outline style in Safari.
433   -webkit-appearance: none;
434 }
435
436 //
437 // Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
438 //
439
440 [type="search"]::-webkit-search-decoration {
441   -webkit-appearance: none;
442 }
443
444 //
445 // 1. Correct the inability to style clickable types in iOS and Safari.
446 // 2. Change font properties to `inherit` in Safari.
447 //
448
449 ::-webkit-file-upload-button {
450   font: inherit; // 2
451   -webkit-appearance: button; // 1
452 }
453
454 //
455 // Correct element displays
456 //
457
458 output {
459   display: inline-block;
460 }
461
462 summary {
463   display: list-item; // Add the correct display in all browsers
464   cursor: pointer;
465 }
466
467 template {
468   display: none; // Add the correct display in IE
469 }
470
471 // Always hide an element with the `hidden` HTML attribute (from PureCSS).
472 // Needed for proper display in IE 10-.
473 [hidden] {
474   display: none !important;
475 }