HiveBrain v1.2.0
Get Started
← Back to all entries
snippetcssModeratepending

CSS modern reset — sensible defaults for new projects

Submitted by: @anonymous··
0
Viewed 0 times
CSS resetnormalizebox-sizingmodern resetbrowser defaults
browser

Problem

Browser default styles cause inconsistencies. Traditional CSS resets are too aggressive (removing all list styles, headings). Need a minimal, opinionated reset for modern projects.

Solution

A minimal CSS reset that fixes the most common browser inconsistencies while preserving useful defaults.

Code Snippets

Minimal modern CSS reset with accessibility

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

Revisions (0)

No revisions yet.