UNPKG

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