reset.scss 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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-image: none; /* 2 */
  155. }
  156. /*
  157. Use the modern Firefox focus style for all focusable elements.
  158. */
  159. :-moz-focusring {
  160. outline: auto;
  161. }
  162. /*
  163. Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
  164. */
  165. :-moz-ui-invalid {
  166. box-shadow: none;
  167. }
  168. /*
  169. Add the correct vertical alignment in Chrome and Firefox.
  170. */
  171. progress {
  172. vertical-align: baseline;
  173. }
  174. /*
  175. Correct the cursor style of increment and decrement buttons in Safari.
  176. */
  177. ::-webkit-inner-spin-button,
  178. ::-webkit-outer-spin-button {
  179. height: auto;
  180. }
  181. /*
  182. 1. Correct the odd appearance in Chrome and Safari.
  183. 2. Correct the outline style in Safari.
  184. */
  185. [type="search"] {
  186. -webkit-appearance: textfield; /* 1 */
  187. outline-offset: -2px; /* 2 */
  188. }
  189. /*
  190. Remove the inner padding in Chrome and Safari on macOS.
  191. */
  192. ::-webkit-search-decoration {
  193. -webkit-appearance: none;
  194. }
  195. /*
  196. 1. Correct the inability to style clickable types in iOS and Safari.
  197. 2. Change font properties to `inherit` in Safari.
  198. */
  199. ::-webkit-file-upload-button {
  200. -webkit-appearance: button; /* 1 */
  201. font: inherit; /* 2 */
  202. }
  203. /*
  204. Add the correct display in Chrome and Safari.
  205. */
  206. summary {
  207. display: list-item;
  208. }
  209. /*
  210. Removes the default spacing and border for appropriate elements.
  211. */
  212. blockquote,
  213. dl,
  214. dd,
  215. h1,
  216. h2,
  217. h3,
  218. h4,
  219. h5,
  220. h6,
  221. hr,
  222. figure,
  223. p,
  224. pre {
  225. margin: 0;
  226. }
  227. fieldset {
  228. margin: 0;
  229. padding: 0;
  230. }
  231. legend {
  232. padding: 0;
  233. }
  234. ol,
  235. ul,
  236. menu {
  237. list-style: none;
  238. margin: 0;
  239. padding: 0;
  240. }
  241. /*
  242. Prevent resizing textareas horizontally by default.
  243. */
  244. textarea {
  245. resize: vertical;
  246. }
  247. /*
  248. 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
  249. 2. Set the default placeholder color to the user's configured gray 400 color.
  250. */
  251. input::placeholder,
  252. textarea::placeholder {
  253. opacity: 1; /* 1 */
  254. color: #9ca3af; /* 2 */
  255. }
  256. /*
  257. Set the default cursor for buttons.
  258. */
  259. button,
  260. [role="button"] {
  261. cursor: pointer;
  262. }
  263. /*
  264. Make sure disabled buttons don't get the pointer cursor.
  265. */
  266. :disabled {
  267. cursor: default;
  268. }
  269. /*
  270. 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
  271. 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
  272. This can trigger a poorly considered lint error in some tools but is included by design.
  273. */
  274. img,
  275. svg,
  276. video,
  277. canvas,
  278. audio,
  279. iframe,
  280. embed,
  281. object {
  282. display: block; /* 1 */
  283. vertical-align: middle; /* 2 */
  284. }
  285. /*
  286. Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
  287. */
  288. img,
  289. video {
  290. max-width: 100%;
  291. height: auto;
  292. }
  293. /*
  294. Ensure the default browser behavior of the `hidden` attribute.
  295. */
  296. [hidden] {
  297. display: none;
  298. }
  299. .dark {
  300. color-scheme: dark;
  301. }
  302. label {
  303. font-weight: 700;
  304. }
  305. *,
  306. *::before,
  307. *::after {
  308. box-sizing: inherit;
  309. }
  310. a:focus,
  311. a:active {
  312. outline: none;
  313. }
  314. a,
  315. a:focus,
  316. a:hover {
  317. cursor: pointer;
  318. color: inherit;
  319. text-decoration: none;
  320. }
  321. div:focus {
  322. outline: none;
  323. }
  324. .clearfix {
  325. &::after {
  326. visibility: hidden;
  327. display: block;
  328. font-size: 0;
  329. content: " ";
  330. clear: both;
  331. height: 0;
  332. }
  333. }