UNPKG

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