In this modern era of web development, we don’t really need a heavy-handed reset, or even a reset at all, because CSS browser compatibility issues are much less likely than they were in the old IE 6 days. Post written by Andy Bell.
A (more) Modern CSS Reset (by Andy Bell / Piccalilli) provides a modern, accessible, and lightweight CSS baseline for web development projects.
Here are the key rules and functionalities included in this reset:
Universal Box Sizing: Applies box-sizing: border-box across all elements and pseudo-elements (*, *::before, *::after).
Font Size Inflation Prevention: Disables automatic mobile text size adjustments (text-size-adjust: none) on the html element.
Balanced Heading Text: Applies text-wrap: balance to headings (h1 through h4) for cleaner layout presentation.
Logical Margin Trimming: Removes the trailing block margin (margin-block-end: 0) on standard text elements (body, p, h1-h4, figure, blockquote, dl, dd).
Tailored Line Heights: Sets a line-height: 1.5 on the body while assigning a shorter 1.1 line height to headings and interactive elements (button, input, label).
Form Font Inheritance: Forces inputs, buttons, textareas, and select controls (input, button, textarea, select) to inherit font family and size from their parent element.
Accessible List Reset: Removes default list styling (list-style: none) specifically on lists with an explicit role="list" attribute to prevent Safari from stripping VoiceOver list semantics.
Unclassed Links: Sets unclassed anchor tags (a:not([class])) to color: currentColor and text-decoration-skip-ink: auto.
Target Scroll Margins: Applies scroll-margin-block: 5ex to targeted elements (:target) so anchored scrolling leaves comfortable breathing room at the top of the screen.
Sizing & Layout Defaults: Sets the body minimum height to 100vh and enforces a minimum height of 10em for textarea elements missing a rows attribute.