_reboot.scss 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. // scss-lint:disable ImportantRule, QualifyingElement, DuplicateProperty
  2. // Reboot
  3. //
  4. // Global resets to common HTML elements and more for easier usage by Bootstrap.
  5. // Adds additional rules on top of Normalize.css, including several overrides.
  6. // Reset the box-sizing
  7. //
  8. // Change from `box-sizing: content-box` to `border-box` so that when you add
  9. // `padding` or `border`s to an element, the overall declared `width` does not
  10. // change. For example, `width: 100px;` will always be `100px` despite the
  11. // `border: 10px solid red;` and `padding: 20px;`.
  12. //
  13. // Heads up! This reset may cause conflicts with some third-party widgets. For
  14. // recommendations on resolving such conflicts, see
  15. // http://getbootstrap.com/getting-started/#third-box-sizing.
  16. //
  17. // Credit: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
  18. html {
  19. box-sizing: border-box;
  20. }
  21. *,
  22. *::before,
  23. *::after {
  24. box-sizing: inherit;
  25. }
  26. // Make viewport responsive
  27. //
  28. // @viewport is needed because IE 10+ doesn't honor <meta name="viewport"> in
  29. // some cases. See http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/.
  30. // Eventually @viewport will replace <meta name="viewport">.
  31. //
  32. // However, `device-width` is broken on IE 10 on Windows (Phone) 8,
  33. // (see http://timkadlec.com/2013/01/windows-phone-8-and-device-width/ and https://github.com/twbs/bootstrap/issues/10497)
  34. // and the fix for that involves a snippet of JavaScript to sniff the user agent
  35. // and apply some conditional CSS.
  36. //
  37. // See http://getbootstrap.com/getting-started/#support-ie10-width for the relevant hack.
  38. //
  39. // Wrap `@viewport` with `@at-root` for when folks do a nested import (e.g.,
  40. // `.class-name { @import "bootstrap"; }`).
  41. @at-root {
  42. @-ms-viewport { width: device-width; }
  43. }
  44. //
  45. // Reset HTML, body, and more
  46. //
  47. html {
  48. // Sets a specific default `font-size` for user with `rem` type scales.
  49. font-size: $font-size-root;
  50. // As a side-effect of setting the @viewport above,
  51. // IE11 & Edge make the scrollbar overlap the content and automatically hide itself when not in use.
  52. // Unfortunately, the auto-showing of the scrollbar is sometimes too sensitive,
  53. // thus making it hard to click on stuff near the right edge of the page.
  54. // So we add this style to force IE11 & Edge to use a "normal", non-overlapping, non-auto-hiding scrollbar.
  55. // See https://github.com/twbs/bootstrap/issues/18543
  56. -ms-overflow-style: scrollbar;
  57. // Changes the default tap highlight to be completely transparent in iOS.
  58. -webkit-tap-highlight-color: rgba(0,0,0,0);
  59. height: 100%;
  60. }
  61. body {
  62. // Make the `body` use the `font-size-root`
  63. font-family: $font-family-base;
  64. font-size: $font-size-base;
  65. line-height: $line-height-base;
  66. // Go easy on the eyes and use something other than `#000` for text
  67. color: $body-color;
  68. // By default, `<body>` has no `background-color` so we set one as a best practice.
  69. background-color: $body-bg;
  70. height: 100%;
  71. }
  72. // Suppress the focus outline on elements that cannot be accessed via keyboard.
  73. // This prevents an unwanted focus outline from appearing around elements that
  74. // might still respond to pointer events.
  75. //
  76. // Credit: https://github.com/suitcss/base
  77. [tabindex="-1"]:focus {
  78. outline: none !important;
  79. }
  80. //
  81. // Typography
  82. //
  83. // Remove top margins from headings
  84. //
  85. // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
  86. // margin for easier control within type scales as it avoids margin collapsing.
  87. h1, h2, h3, h4, h5, h6 {
  88. margin-top: 0;
  89. margin-bottom: .5rem;
  90. }
  91. // Reset margins on paragraphs
  92. //
  93. // Similarly, the top margin on `<p>`s get reset. However, we also reset the
  94. // bottom margin to use `rem` units instead of `em`.
  95. p {
  96. margin-top: 0;
  97. margin-bottom: 1rem;
  98. }
  99. // Abbreviations and acronyms
  100. abbr[title],
  101. // Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257
  102. abbr[data-original-title] {
  103. cursor: help;
  104. border-bottom: 1px dotted $abbr-border-color;
  105. }
  106. address {
  107. margin-bottom: 1rem;
  108. font-style: normal;
  109. line-height: inherit;
  110. }
  111. ol,
  112. ul,
  113. dl {
  114. margin-top: 0;
  115. margin-bottom: 0rem;
  116. }
  117. ol ol,
  118. ul ul,
  119. ol ul,
  120. ul ol {
  121. margin-bottom: 0;
  122. }
  123. dt {
  124. font-weight: $dt-font-weight;
  125. }
  126. dd {
  127. margin-bottom: .5rem;
  128. margin-left: 0; // Undo browser default
  129. }
  130. blockquote {
  131. margin: 0 0 1rem;
  132. }
  133. //
  134. // Links
  135. //
  136. a {
  137. color: $link-color;
  138. text-decoration: $link-decoration;
  139. @include hover-focus {
  140. color: $link-hover-color;
  141. text-decoration: $link-hover-decoration;
  142. }
  143. &:focus {
  144. @include tab-focus();
  145. }
  146. }
  147. //
  148. // Code
  149. //
  150. pre {
  151. // Remove browser default top margin
  152. margin-top: 0;
  153. // Reset browser default of `1em` to use `rem`s
  154. margin-bottom: 1rem;
  155. }
  156. //
  157. // Figures
  158. //
  159. figure {
  160. // Normalize adds `margin` to `figure`s as browsers apply it inconsistently.
  161. // We reset that to create a better flow in-page.
  162. margin: 0 0 1rem;
  163. }
  164. //
  165. // Images
  166. //
  167. img {
  168. // By default, `<img>`s are `inline-block`. This assumes that, and vertically
  169. // centers them. This won't apply should you reset them to `block` level.
  170. vertical-align: middle;
  171. // Note: `<img>`s are deliberately not made responsive by default.
  172. // For the rationale behind this, see the comments on the `.img-fluid` class.
  173. }
  174. // iOS "clickable elements" fix for role="button"
  175. //
  176. // Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
  177. // for traditionally non-focusable elements with role="button"
  178. // see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
  179. [role="button"] {
  180. cursor: pointer;
  181. }
  182. // Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.
  183. //
  184. // In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11
  185. // DON'T remove the click delay when `<meta name="viewport" content="width=device-width">` is present.
  186. // However, they DO support removing the click delay via `touch-action: manipulation`.
  187. // See:
  188. // * http://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch
  189. // * http://caniuse.com/#feat=css-touch-action
  190. // * http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay
  191. a,
  192. area,
  193. button,
  194. [role="button"],
  195. input,
  196. label,
  197. select,
  198. summary,
  199. textarea {
  200. touch-action: manipulation;
  201. }
  202. //
  203. // Tables
  204. //
  205. table {
  206. // Reset for nesting within parents with `background-color`.
  207. background-color: $table-bg;
  208. }
  209. caption {
  210. padding-top: $table-cell-padding;
  211. padding-bottom: $table-cell-padding;
  212. color: $text-muted;
  213. text-align: left;
  214. caption-side: bottom;
  215. }
  216. th {
  217. // Centered by default, but left-align-ed to match the `td`s below.
  218. text-align: left;
  219. }
  220. //
  221. // Forms
  222. //
  223. label {
  224. // Allow labels to use `margin` for spacing.
  225. display: inline-block;
  226. }
  227. // Work around a Firefox/IE bug where the transparent `button` background
  228. // results in a loss of the default `button` focus styles.
  229. //
  230. // Credit: https://github.com/suitcss/base/
  231. button:focus {
  232. outline: 1px dotted;
  233. outline: 5px auto -webkit-focus-ring-color;
  234. }
  235. input,
  236. button,
  237. select,
  238. textarea {
  239. // Remove all `margin`s so our classes don't have to do it themselves.
  240. margin: 0;
  241. // Normalize includes `font: inherit;`, so `font-family`. `font-size`, etc are
  242. // properly inherited. However, `line-height` isn't addressed there. Using this
  243. // ensures we don't need to unnecessarily redeclare the global font stack.
  244. line-height: inherit;
  245. // iOS adds rounded borders by default
  246. border-radius: 0;
  247. }
  248. textarea {
  249. // Textareas should really only resize vertically so they don't break their (horizontal) containers.
  250. resize: vertical;
  251. }
  252. fieldset {
  253. // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
  254. // so we reset that to ensure it behaves more like a standard block element.
  255. // See https://github.com/twbs/bootstrap/issues/12359.
  256. min-width: 0;
  257. // Reset the default outline behavior of fieldsets so they don't affect page layout.
  258. padding: 0;
  259. margin: 0;
  260. border: 0;
  261. }
  262. legend {
  263. // Reset the entire legend element to match the `fieldset`
  264. display: block;
  265. width: 100%;
  266. padding: 0;
  267. margin-bottom: .5rem;
  268. font-size: 1.5rem;
  269. line-height: inherit;
  270. // border: 0;
  271. }
  272. input[type="search"] {
  273. // This overrides the extra rounded corners on search inputs in iOS so that our
  274. // `.form-control` class can properly style them. Note that this cannot simply
  275. // be added to `.form-control` as it's not specific enough. For details, see
  276. // https://github.com/twbs/bootstrap/issues/11586.
  277. -webkit-appearance: none;
  278. }
  279. // todo: needed?
  280. output {
  281. display: inline-block;
  282. // font-size: $font-size-base;
  283. // line-height: $line-height;
  284. // color: $input-color;
  285. }
  286. // Always hide an element with the `hidden` HTML attribute (from PureCSS).
  287. [hidden] {
  288. display: none !important;
  289. }