preflight.css 7.0 KB

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