_reboot.scss 7.7 KB

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