Skip to content

Search

Start typing to search.


Show all pages

Documentation

type

Icon

An inline SVG that sits on the text baseline and scales with the surrounding font size.

NewCSS onlyPlain classes; no JavaScript in any stack.

Usage

The icon takes the surrounding text size and color, so it reads as part of the sentence.

Lesson published just now

Reminder set for tomorrow at 9:00

HTML

Examples

Sizes

Sizes are set in ems, so the same icon grows when the text around it is larger.

A heading grows the icon with it

HTML

Guidance and accessibility

When to use

  • Put ca-icon on any inline <svg> so it behaves like a glyph: sized in ems, on the baseline, never shrinking inside a flex row.
  • Because the size is relative, an icon inside a heading or a large button scales with it — no extra class needed per context.
  • The icon inherits currentColor; color it through the text color of its parent.

Accessibility

  • Give decorative icons aria-hidden="true" so screen readers skip them.
  • A meaningful icon needs a name — on an icon-only button that is the aria-label on the button; a standalone informational icon gets role="img" and an aria-label of its own.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the icon component
ClassKindUse it for
ca-iconComponentThe SVG; sized to the font and aligned to the text baseline.
ca-icon--smSizeSlightly smaller than the surrounding text.
ca-icon--lgSizeA larger icon, such as in a button or lead paragraph.
ca-icon--xlSizeThe largest preset, for headings and hero marks.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Lesson published just now

Reminder set for tomorrow at 9:00

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Lesson published just now

Reminder set for tomorrow at 9:00

Bloque skin

Example skin pushed far from base: square, heavy, offset shadows, larger targets.

Lesson published just now

Reminder set for tomorrow at 9:00

Pliego skin

Example skin from the press sheet: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Lesson published just now

Reminder set for tomorrow at 9:00

Framework notes

Link the prebuilt stylesheet of your skin next to your brand stylesheet. No build step.

HTML
<link rel="stylesheet" href="brand.css" />
<link rel="stylesheet" href="ca-base.css" />