preflight.css 7.1 KB

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