CSS Reset

Lightpack includes a modern CSS reset that ensures consistent styling across all browsers while providing sensible defaults that work with the framework's design system.

Features


What's Included

Box Sizing

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

Body Defaults

Typography

Headings:

Heading Sizes:

Paragraphs:

Links

Horizontal Rules

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--g-4) 0;
}

Images

Code & Pre

Text Formatting

Form Elements

All form elements inherit font properties from parent:

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

Accessibility

Reduced Motion Support:

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

Usage

The reset is automatically included when you import Lightpack CSS:

<link rel="stylesheet" href="lightpack.min.css">

Import Order (in source):

  1. Variables
  2. Reset ← You are here
  3. Utilities
  4. Layout
  5. Components

Customization

All reset styles use CSS variables, so you can customize them by overriding variables:

:root {
  --color-background: #f5f5f5;
  --color-text: #1a1a1a;
  --font-family: 'Inter', sans-serif;
  --fs-base: 18px;
}

Dark Theme Support

The reset automatically adapts to dark theme when .theme-dark is applied to <body>:


Browser Compatibility


See /src/css/_reset.css for complete implementation.