_reset.less 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Reset, based on normalize.css v3.0.2 | MIT License | git.io/normalize
  7. // _____________________________________________
  8. html {
  9. // Prevent iOS text size adjust after orientation change, without disabling user zoom.
  10. -ms-text-size-adjust: 100%;
  11. -webkit-text-size-adjust: 100%;
  12. box-sizing: border-box;
  13. text-size-adjust: 100%;
  14. }
  15. * {
  16. box-sizing: inherit;
  17. &:before,
  18. &:after {
  19. box-sizing: inherit;
  20. }
  21. &:focus {
  22. box-shadow: none;
  23. outline: 0;
  24. }
  25. }
  26. // Keyboard actions detection helper
  27. ._keyfocus * {
  28. &:focus {
  29. box-shadow: @focus__box-shadow;
  30. }
  31. }
  32. // Remove default margin.
  33. body {
  34. margin: 0;
  35. }
  36. //
  37. // HTML5 display definitions
  38. // ---------------------------------------------
  39. // Correct 'block' display not defined for any HTML5 element in IE 8/9.
  40. // Correct 'block' display not defined for 'details' or 'summary' in IE 10/11 and Firefox.
  41. // Correct 'block' display not defined for 'main' in IE 11.
  42. article,
  43. aside,
  44. details,
  45. figcaption,
  46. figure,
  47. footer,
  48. header,
  49. main,
  50. menu,
  51. nav,
  52. section,
  53. summary {
  54. display: block;
  55. }
  56. audio,
  57. canvas,
  58. progress,
  59. video {
  60. display: inline-block; // Correct 'inline-block' display not defined in IE 8/9.
  61. vertical-align: baseline; // Normalize vertical alignment of 'progress' in Chrome, Firefox, and Opera.
  62. }
  63. audio:not([controls]) {
  64. display: none; // Prevent modern browsers from displaying 'audio' without controls.
  65. height: 0; // Remove excess height in iOS 5 devices.
  66. }
  67. // Address '[hidden]' styling not present in IE 8/9/10.
  68. // Hide the 'template' element in IE 8/9/11, Safari, and Firefox < 22.
  69. [hidden],
  70. template {
  71. display: none;
  72. }
  73. //
  74. // Links
  75. // ---------------------------------------------
  76. a {
  77. // Improve readability when focused and also mouse hovered in all browsers.
  78. &:active,
  79. &:hover {
  80. outline: 0;
  81. }
  82. }
  83. //
  84. // Text-level semantics
  85. // ---------------------------------------------
  86. // Address styling not present in IE 8/9/10/11, Safari, and Chrome.
  87. abbr {
  88. &[title] {
  89. border-bottom: 1px dotted;
  90. }
  91. }
  92. // Address style set to 'bolder' in Firefox 4 and later, Safari, and Chrome.
  93. b,
  94. strong {
  95. font-weight: bold;
  96. }
  97. // Address styling not present in Safari and Chrome.
  98. dfn {
  99. font-style: italic;
  100. }
  101. // Address styling not present in IE 8/9.
  102. mark {
  103. background: @color-yellow1;
  104. color: @color-black;
  105. }
  106. // Prevent 'sub' and 'sup' affecting 'line-height' in all browsers.
  107. sub,
  108. sup {
  109. font-size: 75%;
  110. line-height: 0;
  111. position: relative;
  112. vertical-align: baseline;
  113. }
  114. sup {
  115. top: -.5em;
  116. }
  117. sub {
  118. bottom: -.25em;
  119. }
  120. //
  121. // Embedded content
  122. // ---------------------------------------------
  123. // Remove border when inside 'a' element in IE 8/9/10.
  124. img {
  125. border: 0;
  126. }
  127. // Responsive width
  128. img,
  129. video,
  130. embed,
  131. object {
  132. max-width: 100%;
  133. }
  134. // Correct overflow not hidden in IE 9/10/11.
  135. svg {
  136. &:not(:root) {
  137. overflow: hidden;
  138. }
  139. }
  140. //
  141. // Grouping content
  142. // ---------------------------------------------
  143. // Address margin not present in IE 8/9 and Safari.
  144. figure {
  145. margin: 1em 40px;
  146. }
  147. // Address differences between Firefox and other browsers.
  148. hr {
  149. -moz-box-sizing: content-box;
  150. box-sizing: content-box;
  151. height: 0;
  152. }
  153. // Contain overflow in all browsers.
  154. pre {
  155. overflow: auto;
  156. }
  157. // Address odd 'em'-unit font size rendering in all browsers.
  158. code,
  159. kbd,
  160. pre,
  161. samp {
  162. font-family: monospace, monospace;
  163. font-size: 1em;
  164. }
  165. //
  166. // Forms
  167. // ---------------------------------------------
  168. // Known limitation: by default, Chrome and Safari on OS X allow very limited styling of 'select', unless a 'border' property is set.
  169. button,
  170. input,
  171. optgroup,
  172. select,
  173. textarea {
  174. color: inherit; // Correct color not being inherited. Known issue affects color of disabled elements.
  175. font: inherit; // Correct font properties not being inherited.
  176. margin: 0; // Address margins set differently in Firefox 4 and later, Safari, and Chrome.
  177. }
  178. // Address 'overflow' set to 'hidden' in IE 8/9/10/11.
  179. button {
  180. overflow: visible;
  181. }
  182. // Address inconsistent 'text-transform' inheritance for 'button' and 'select'.
  183. // All other form control elements do not inherit 'text-transform' values.
  184. // Correct 'button' style inheritance in Firefox, IE 8/9/10/11, and Opera.
  185. // Correct 'select' style inheritance in Firefox.
  186. button,
  187. select {
  188. text-transform: none;
  189. }
  190. // Avoid the WebKit bug in Android 4.0.* where (2) destroys native 'audio' and 'video' controls.
  191. // Correct inability to style clickable 'input' types in iOS.
  192. // Improve usability and consistency of cursor style between image-type 'input' and others.
  193. button,
  194. html input[type='button'],
  195. input[type='reset'],
  196. input[type='submit'] {
  197. -webkit-appearance: button;
  198. appearance: button;
  199. cursor: pointer;
  200. }
  201. // Re-set default cursor for disabled elements.
  202. button[disabled],
  203. html input[disabled] {
  204. cursor: default;
  205. }
  206. // Remove inner padding and border in Firefox 4 and later.
  207. button,
  208. input {
  209. &::-moz-focus-inner {
  210. border: 0;
  211. padding: 0;
  212. }
  213. }
  214. // Address Firefox 4 and later setting 'line-height' on 'input' using '!important' in the UA stylesheet.
  215. input {
  216. line-height: normal;
  217. }
  218. // Firefox's implementation doesn't respect box-sizing, padding, or width.
  219. input[type='checkbox'],
  220. input[type='radio'] {
  221. box-sizing: border-box; // Address box sizing set to 'content-box' in IE 8/9/10.
  222. padding: 0; // Remove excess padding in IE 8/9/10.
  223. }
  224. // Fix the cursor style for Chrome's increment/decrement buttons. For certain 'font-size' values of the 'input', it causes the cursor style of the decrement button to change from 'default' to 'text'.
  225. input[type='number'] {
  226. &::-webkit-inner-spin-button,
  227. &::-webkit-outer-spin-button {
  228. height: auto;
  229. }
  230. }
  231. // Address 'appearance' set to 'searchfield' in Safari and Chrome.
  232. input[type='search'] {
  233. -webkit-appearance: textfield;
  234. appearance: textfield;
  235. }
  236. // Remove inner padding and search cancel button in Safari and Chrome on OS X.
  237. // Safari (but not Chrome) clips the cancel button when the search input has padding (and 'textfield' appearance).
  238. input[type='search'] {
  239. &::-webkit-search-cancel-button,
  240. &::-webkit-search-decoration {
  241. -webkit-appearance: none;
  242. appearance: none;
  243. }
  244. }
  245. // Correct 'color' not being inherited in IE 8/9/10/11.
  246. // Remove padding so people aren't caught out if they zero out fieldsets.
  247. legend {
  248. border: 0;
  249. padding: 0;
  250. }
  251. // Remove default vertical scrollbar in IE 8/9/10/11.
  252. textarea {
  253. overflow: auto;
  254. }
  255. // Don't inherit the 'font-weight' (applied by a rule above).
  256. // NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
  257. optgroup {
  258. font-weight: bold;
  259. }
  260. //
  261. // Tables
  262. // ---------------------------------------------
  263. // Remove most spacing between table cells.
  264. table {
  265. border-collapse: collapse;
  266. border-spacing: 0;
  267. }
  268. td,
  269. th {
  270. padding: 0;
  271. }