reset.scss 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. /*
  2. 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
  3. 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
  4. */
  5. *,
  6. ::before,
  7. ::after {
  8. box-sizing: border-box; /* 1 */
  9. border-width: 0; /* 2 */
  10. border-style: solid; /* 2 */
  11. border-color: currentColor; /* 2 */
  12. }
  13. /*
  14. 1. Use a consistent sensible line-height in all browsers.
  15. 2. Prevent adjustments of font size after orientation changes in iOS.
  16. 3. Use a more readable tab size.
  17. 4. Use the user's configured `sans` font-family by default.
  18. */
  19. html {
  20. line-height: 1.5; /* 1 */
  21. -webkit-text-size-adjust: 100%; /* 2 */
  22. -moz-tab-size: 4; /* 3 */
  23. tab-size: 4; /* 3 */
  24. font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
  25. "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  26. }
  27. /*
  28. 1. Remove the margin in all browsers.
  29. 2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
  30. */
  31. body {
  32. margin: 0; /* 1 */
  33. line-height: inherit; /* 2 */
  34. }
  35. /*
  36. 1. Add the correct height in Firefox.
  37. 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
  38. 3. Ensure horizontal rules are visible by default.
  39. */
  40. hr {
  41. height: 0; /* 1 */
  42. color: inherit; /* 2 */
  43. border-top-width: 1px; /* 3 */
  44. }
  45. /*
  46. Add the correct text decoration in Chrome, Edge, and Safari.
  47. */
  48. abbr:where([title]) {
  49. text-decoration: underline dotted;
  50. }
  51. /*
  52. Remove the default font size and weight for headings.
  53. */
  54. h1,
  55. h2,
  56. h3,
  57. h4,
  58. h5,
  59. h6 {
  60. font-size: inherit;
  61. font-weight: inherit;
  62. }
  63. /*
  64. Reset links to optimize for opt-in styling instead of opt-out.
  65. */
  66. a {
  67. color: inherit;
  68. text-decoration: inherit;
  69. }
  70. /*
  71. Add the correct font weight in Edge and Safari.
  72. */
  73. b,
  74. strong {
  75. font-weight: bolder;
  76. }
  77. /*
  78. 1. Use the user's configured `mono` font family by default.
  79. 2. Correct the odd `em` font sizing in all browsers.
  80. */
  81. code,
  82. kbd,
  83. samp,
  84. pre {
  85. font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
  86. "Liberation Mono", "Courier New", monospace; /* 1 */
  87. font-size: 1em; /* 2 */
  88. }
  89. /*
  90. Add the correct font size in all browsers.
  91. */
  92. small {
  93. font-size: 80%;
  94. }
  95. /*
  96. Prevent `sub` and `sup` elements from affecting the line height in all browsers.
  97. */
  98. sub,
  99. sup {
  100. font-size: 75%;
  101. line-height: 0;
  102. position: relative;
  103. vertical-align: baseline;
  104. }
  105. sub {
  106. bottom: -0.25em;
  107. }
  108. sup {
  109. top: -0.5em;
  110. }
  111. /*
  112. 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
  113. 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
  114. 3. Remove gaps between table borders by default.
  115. */
  116. table {
  117. text-indent: 0; /* 1 */
  118. border-color: inherit; /* 2 */
  119. border-collapse: collapse; /* 3 */
  120. }
  121. /*
  122. 1. Change the font styles in all browsers.
  123. 2. Remove the margin in Firefox and Safari.
  124. 3. Remove default padding in all browsers.
  125. */
  126. button,
  127. input,
  128. optgroup,
  129. select,
  130. textarea {
  131. font-family: inherit; /* 1 */
  132. font-size: 100%; /* 1 */
  133. line-height: inherit; /* 1 */
  134. color: inherit; /* 1 */
  135. margin: 0; /* 2 */
  136. padding: 0; /* 3 */
  137. }
  138. /*
  139. Remove the inheritance of text transform in Edge and Firefox.
  140. */
  141. button,
  142. select {
  143. text-transform: none;
  144. }
  145. /*
  146. 1. Correct the inability to style clickable types in iOS and Safari.
  147. 2. Remove default button styles.
  148. */
  149. button,
  150. [type="button"],
  151. [type="reset"],
  152. [type="submit"] {
  153. -webkit-appearance: button; /* 1 */
  154. background-color: transparent; /* 2 */
  155. background-image: none; /* 2 */
  156. }
  157. /*
  158. Use the modern Firefox focus style for all focusable elements.
  159. */
  160. :-moz-focusring {
  161. outline: auto;
  162. }
  163. /*
  164. Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
  165. */
  166. :-moz-ui-invalid {
  167. box-shadow: none;
  168. }
  169. /*
  170. Add the correct vertical alignment in Chrome and Firefox.
  171. */
  172. progress {
  173. vertical-align: baseline;
  174. }
  175. /*
  176. Correct the cursor style of increment and decrement buttons in Safari.
  177. */
  178. ::-webkit-inner-spin-button,
  179. ::-webkit-outer-spin-button {
  180. height: auto;
  181. }
  182. /*
  183. 1. Correct the odd appearance in Chrome and Safari.
  184. 2. Correct the outline style in Safari.
  185. */
  186. [type="search"] {
  187. -webkit-appearance: textfield; /* 1 */
  188. outline-offset: -2px; /* 2 */
  189. }
  190. /*
  191. Remove the inner padding in Chrome and Safari on macOS.
  192. */
  193. ::-webkit-search-decoration {
  194. -webkit-appearance: none;
  195. }
  196. /*
  197. 1. Correct the inability to style clickable types in iOS and Safari.
  198. 2. Change font properties to `inherit` in Safari.
  199. */
  200. ::-webkit-file-upload-button {
  201. -webkit-appearance: button; /* 1 */
  202. font: inherit; /* 2 */
  203. }
  204. /*
  205. Add the correct display in Chrome and Safari.
  206. */
  207. summary {
  208. display: list-item;
  209. }
  210. /*
  211. Removes the default spacing and border for appropriate elements.
  212. */
  213. blockquote,
  214. dl,
  215. dd,
  216. h1,
  217. h2,
  218. h3,
  219. h4,
  220. h5,
  221. h6,
  222. hr,
  223. figure,
  224. p,
  225. pre {
  226. margin: 0;
  227. }
  228. fieldset {
  229. margin: 0;
  230. padding: 0;
  231. }
  232. legend {
  233. padding: 0;
  234. }
  235. ol,
  236. ul,
  237. menu {
  238. list-style: none;
  239. margin: 0;
  240. padding: 0;
  241. }
  242. /*
  243. Prevent resizing textareas horizontally by default.
  244. */
  245. textarea {
  246. resize: vertical;
  247. }
  248. /*
  249. 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
  250. 2. Set the default placeholder color to the user's configured gray 400 color.
  251. */
  252. input::placeholder,
  253. textarea::placeholder {
  254. opacity: 1; /* 1 */
  255. color: #9ca3af; /* 2 */
  256. }
  257. /*
  258. Set the default cursor for buttons.
  259. */
  260. button,
  261. [role="button"] {
  262. cursor: pointer;
  263. }
  264. /*
  265. Make sure disabled buttons don't get the pointer cursor.
  266. */
  267. :disabled {
  268. cursor: default;
  269. }
  270. /*
  271. 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
  272. 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
  273. This can trigger a poorly considered lint error in some tools but is included by design.
  274. */
  275. img,
  276. svg,
  277. video,
  278. canvas,
  279. audio,
  280. iframe,
  281. embed,
  282. object {
  283. display: block; /* 1 */
  284. vertical-align: middle; /* 2 */
  285. }
  286. /*
  287. Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
  288. */
  289. img,
  290. video {
  291. max-width: 100%;
  292. height: auto;
  293. }
  294. /*
  295. Ensure the default browser behavior of the `hidden` attribute.
  296. */
  297. [hidden] {
  298. display: none;
  299. }
  300. .dark {
  301. color-scheme: dark;
  302. }
  303. label {
  304. font-weight: 700;
  305. }
  306. *,
  307. *::before,
  308. *::after {
  309. box-sizing: inherit;
  310. }
  311. a:focus,
  312. a:active {
  313. outline: none;
  314. }
  315. a,
  316. a:focus,
  317. a:hover {
  318. cursor: pointer;
  319. color: inherit;
  320. text-decoration: none;
  321. }
  322. div:focus {
  323. outline: none;
  324. }
  325. .clearfix {
  326. &::after {
  327. visibility: hidden;
  328. display: block;
  329. font-size: 0;
  330. content: " ";
  331. clear: both;
  332. height: 0;
  333. }
  334. }