_reboot.scss 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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. width: 100%;
  72. position: absolute;
  73. }
  74. // Suppress the focus outline on elements that cannot be accessed via keyboard.
  75. // This prevents an unwanted focus outline from appearing around elements that
  76. // might still respond to pointer events.
  77. //
  78. // Credit: https://github.com/suitcss/base
  79. [tabindex="-1"]:focus {
  80. outline: none !important;
  81. }
  82. //
  83. // Typography
  84. //
  85. // Remove top margins from headings
  86. //
  87. // By default, `<h1>`-`<h6>` all receive top and bottom margins. We nuke the top
  88. // margin for easier control within type scales as it avoids margin collapsing.
  89. h1, h2, h3, h4, h5, h6 {
  90. margin-top: 0;
  91. margin-bottom: .5rem;
  92. }
  93. // Reset margins on paragraphs
  94. //
  95. // Similarly, the top margin on `<p>`s get reset. However, we also reset the
  96. // bottom margin to use `rem` units instead of `em`.
  97. p {
  98. margin-top: 0;
  99. margin-bottom: 1rem;
  100. }
  101. // Abbreviations and acronyms
  102. abbr[title],
  103. // Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257
  104. abbr[data-original-title] {
  105. cursor: help;
  106. border-bottom: 1px dotted $abbr-border-color;
  107. }
  108. address {
  109. margin-bottom: 1rem;
  110. font-style: normal;
  111. line-height: inherit;
  112. }
  113. ol,
  114. ul,
  115. dl {
  116. margin-top: 0;
  117. margin-bottom: 0rem;
  118. }
  119. ol ol,
  120. ul ul,
  121. ol ul,
  122. ul ol {
  123. margin-bottom: 0;
  124. }
  125. dt {
  126. font-weight: $dt-font-weight;
  127. }
  128. dd {
  129. margin-bottom: .5rem;
  130. margin-left: 0; // Undo browser default
  131. }
  132. blockquote {
  133. margin: 0 0 1rem;
  134. }
  135. //
  136. // Links
  137. //
  138. a {
  139. color: $link-color;
  140. text-decoration: $link-decoration;
  141. @include hover-focus {
  142. color: $link-hover-color;
  143. text-decoration: $link-hover-decoration;
  144. }
  145. &:focus {
  146. @include tab-focus();
  147. }
  148. }
  149. //
  150. // Code
  151. //
  152. pre {
  153. // Remove browser default top margin
  154. margin-top: 0;
  155. // Reset browser default of `1em` to use `rem`s
  156. margin-bottom: 1rem;
  157. }
  158. //
  159. // Figures
  160. //
  161. figure {
  162. // Normalize adds `margin` to `figure`s as browsers apply it inconsistently.
  163. // We reset that to create a better flow in-page.
  164. margin: 0 0 1rem;
  165. }
  166. //
  167. // Images
  168. //
  169. img {
  170. // By default, `<img>`s are `inline-block`. This assumes that, and vertically
  171. // centers them. This won't apply should you reset them to `block` level.
  172. vertical-align: middle;
  173. // Note: `<img>`s are deliberately not made responsive by default.
  174. // For the rationale behind this, see the comments on the `.img-fluid` class.
  175. }
  176. // iOS "clickable elements" fix for role="button"
  177. //
  178. // Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
  179. // for traditionally non-focusable elements with role="button"
  180. // see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
  181. [role="button"] {
  182. cursor: pointer;
  183. }
  184. // Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.
  185. //
  186. // In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11
  187. // DON'T remove the click delay when `<meta name="viewport" content="width=device-width">` is present.
  188. // However, they DO support removing the click delay via `touch-action: manipulation`.
  189. // See:
  190. // * http://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch
  191. // * http://caniuse.com/#feat=css-touch-action
  192. // * http://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay
  193. a,
  194. area,
  195. button,
  196. [role="button"],
  197. input,
  198. label,
  199. select,
  200. summary,
  201. textarea {
  202. touch-action: manipulation;
  203. }
  204. //
  205. // Tables
  206. //
  207. table {
  208. // Reset for nesting within parents with `background-color`.
  209. background-color: $table-bg;
  210. }
  211. caption {
  212. padding-top: $table-cell-padding;
  213. padding-bottom: $table-cell-padding;
  214. color: $text-muted;
  215. text-align: left;
  216. caption-side: bottom;
  217. }
  218. th {
  219. // Centered by default, but left-align-ed to match the `td`s below.
  220. text-align: left;
  221. }
  222. //
  223. // Forms
  224. //
  225. label {
  226. // Allow labels to use `margin` for spacing.
  227. display: inline-block;
  228. }
  229. // Work around a Firefox/IE bug where the transparent `button` background
  230. // results in a loss of the default `button` focus styles.
  231. //
  232. // Credit: https://github.com/suitcss/base/
  233. button:focus {
  234. outline: 1px dotted;
  235. outline: 5px auto -webkit-focus-ring-color;
  236. }
  237. input,
  238. button,
  239. select,
  240. textarea {
  241. // Remove all `margin`s so our classes don't have to do it themselves.
  242. margin: 0;
  243. // Normalize includes `font: inherit;`, so `font-family`. `font-size`, etc are
  244. // properly inherited. However, `line-height` isn't addressed there. Using this
  245. // ensures we don't need to unnecessarily redeclare the global font stack.
  246. line-height: inherit;
  247. // iOS adds rounded borders by default
  248. border-radius: 0;
  249. }
  250. textarea {
  251. // Textareas should really only resize vertically so they don't break their (horizontal) containers.
  252. resize: vertical;
  253. }
  254. fieldset {
  255. // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
  256. // so we reset that to ensure it behaves more like a standard block element.
  257. // See https://github.com/twbs/bootstrap/issues/12359.
  258. min-width: 0;
  259. // Reset the default outline behavior of fieldsets so they don't affect page layout.
  260. padding: 0;
  261. margin: 0;
  262. border: 0;
  263. }
  264. legend {
  265. // Reset the entire legend element to match the `fieldset`
  266. display: block;
  267. width: 100%;
  268. padding: 0;
  269. margin-bottom: .5rem;
  270. font-size: 1.5rem;
  271. line-height: inherit;
  272. // border: 0;
  273. }
  274. input[type="search"] {
  275. // This overrides the extra rounded corners on search inputs in iOS so that our
  276. // `.form-control` class can properly style them. Note that this cannot simply
  277. // be added to `.form-control` as it's not specific enough. For details, see
  278. // https://github.com/twbs/bootstrap/issues/11586.
  279. -webkit-appearance: none;
  280. }
  281. // todo: needed?
  282. output {
  283. display: inline-block;
  284. // font-size: $font-size-base;
  285. // line-height: $line-height;
  286. // color: $input-color;
  287. }
  288. // Always hide an element with the `hidden` HTML attribute (from PureCSS).
  289. [hidden] {
  290. display: none !important;
  291. }