AntaNormalization
Switch to dark theme
Search documentation
On this page

Normalization

reset.css gives plain HTML (<h2>, <ul>, <a>, <table>) the same baseline as Anta components.

It is a separate import in @layer anta.reset. Override individual rules, or omit it when another reset provides the baseline.

import '@antadesign/anta/tokens.css' // design tokens
import '@antadesign/anta/reset.css' // ← this page (optional)
import '@antadesign/anta/elements' // web components (client-side only)

What it normalizes

Structural reset

Typography (Anta’s opinion)

These defaults make raw markup match Anta components.

See src/reset.css for the full set. Heading values are duplicated in src/elements/a-title.css and kept in sync.

Cascade layers — how to override

Every Anta stylesheet reserves the same layer order before defining its rules. This keeps granular imports safe when a bundler loads component CSS before tokens.css:

@layer base, anta, components, utilities;
@layer anta.reset, anta.components, anta.theme;

Anta uses child layers inside @layer anta: anta.reset, anta.components, and the optional anta.theme.

Don’t add an unlayered universal reset. It overrides Anta’s element defaults. Anta already applies box-sizing and margin: 0; delete duplicates, or put your reset in @layer base.

Override one thing

Write the rule unlayered (or in a layer after anta) — targeting a specific element, not *:

/* wins over Anta's @layer anta.reset — no !important */
h2 { letter-spacing: -0.01em; }

Use a different reset

Because reset.css is a separate import, omit it when your own reset governs typography. Keep the tokens and elements:

import '@antadesign/anta/tokens.css' // keep — tokens
import '@antadesign/anta/elements' // keep — components
// no '@antadesign/anta/reset.css' // your reset is in charge

One dependency to keep: Anta’s elements don’t set their own box-sizing — they assume the global * { box-sizing: border-box } that this reset provides. Every common reset (normalize.css, Tailwind’s preflight, and others) sets it too. If yours does not, keep that rule or component padding, max-width, and icon-button sizing will be slightly off.

Or import both and override only the pieces you want (unlayered, or in a later layer).

Why it’s opinionated

The reset gives headings, lists, links, and tables the same baseline as Anta components. Omit it when your own reset should control them.

Default HTML tags

Tags styled by the reset, rendered live.

Heading two

Heading three

Heading four

Body text with a link, strong, em, inline code, Ctrl, samp output, a defined term, small print, mark, abbr, deleted, inserted, the variable w, H2O and x2.

A blockquote, marked by a rule rather than an indent.
  • Unordered item
  • Second item
  1. Ordered item
  2. Second item
Term
Definition
a code block
Table caption
HeaderAnother
CellCell
CellCell
A figcaption

abbr, q, and cite keep browser typographic styles. dd has no browser indent because the reset clears margins. The reset adds no kbd typography.