UNPKG

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