reset.css
1 /* 2 * SPDX-FileCopyrightText: Andy Bell 3 * 4 * SPDX-License-Identifier: MIT 5 */ 6 7 /* Box sizing rules */ 8 *, 9 *::before, 10 *::after { 11 box-sizing: border-box; 12 } 13 14 /* Prevent font size inflation */ 15 html { 16 -moz-text-size-adjust: none; 17 -webkit-text-size-adjust: none; 18 text-size-adjust: none; 19 } 20 21 /* Remove default margin in favour of better control in authored CSS */ 22 body, h1, h2, h3, h4, p, 23 figure, blockquote, dl, dd { 24 margin-block-end: 0; 25 } 26 27 /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */ 28 ul[role='list'], 29 ol[role='list'] { 30 list-style: none; 31 } 32 33 /* Set core body defaults */ 34 body { 35 line-height: 1.5; 36 } 37 38 /* Set shorter line heights on headings and interactive elements */ 39 h1, h2, h3, h4, 40 button, input, label { 41 line-height: 1.1; 42 } 43 44 /* Balance text wrapping on headings */ 45 h1, h2, 46 h3, h4 { 47 text-wrap: balance; 48 } 49 50 /* A elements that don't have a class get default styles */ 51 a:not([class]) { 52 text-decoration-skip-ink: auto; 53 } 54 55 /* Make images easier to work with */ 56 img, 57 picture { 58 max-width: 100%; 59 display: block; 60 } 61 62 /* Inherit fonts for inputs and buttons */ 63 input, button, 64 textarea, select { 65 font: inherit; 66 } 67 68 /* Make sure textareas without a rows attribute are not tiny */ 69 textarea:not([rows]) { 70 min-height: 10em; 71 } 72 73 /* Anything that has been anchored to should have extra scroll margin */ 74 :target { 75 scroll-margin-block: 5ex; 76 }