UNPKG

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