REFERENCE / EXAMPLES

Data attributes

Choose a setting on the page or a local section. All core settings inherit through the subtree and affect their supported descendants. Set defaults once on html, then add local attributes only for exceptions.

Light and dark use the same component defaults with different palettes. Configure only what you need to change. For the model behind these examples, read styling and inheritance.

Configure the whole page once

Use the global stylesheet and set defaults on html. Native controls, tables and images follow them automatically; layout settings affect the existing layout classes.

HTMLSelect text to copy
<html data-theme="dark" data-accent="violet"
      data-width="narrow" data-table="striped"
      data-size="large" data-gap="large"
      data-ratio="square" data-fit="contain">
  <!-- Your ordinary HTML goes here. -->
</html>

Open a page with defaults on html · Dark version

Defaults and supported targets

The attribute API reference is the single table of accepted values, omitted defaults and supported targets. This page shows working HTML for each setting.

Settings apply where meaningful: size affects documented controls and components, width affects containers, and fit affects media. A theme does not inject attributes into children. Native validation, focus and system preferences retain their documented behaviour.

Inherited defaults and local exceptions

This demo applies those six defaults to its surrounding section. No attributes are repeated on the inherited controls, table or image. The final section resets individual settings.

Inherited page defaults

The controls, tables, layouts and images below need no repeated settings.

Styled link
Inherited striped table
ProjectStatus
WebsiteReady
DocsIn review
Hills illustration contained inside an inherited square
Inherited square ratio and contain fit.

Local exceptions

Plain reset
ItemState
OneReady
TwoReady
Hills illustration at its natural ratio
HTMLSelect text to copy
<section data-width="narrow" data-table="striped" data-size="large" data-ratio="square" data-fit="contain" data-gap="large">
<div class="container" id="defaults-container">
  <div class="stack" id="defaults-stack">
    <section>
      <h2>Inherited page defaults</h2>
      <p id="defaults-text">The controls, tables, layouts and images below need no repeated settings.</p>
      <div class="row" id="defaults-row">
        <button type="button" id="defaults-button">Inherited large</button>
        <a class="button" id="defaults-link" href="#defaults-reset">Styled link</a>
      </div>
    </section>
    <section class="stack">
      <div><label for="defaults-input">Project name</label><input id="defaults-input" placeholder="My project"></div>
      <div><label for="defaults-select">Category</label><select id="defaults-select"><option>Website</option><option>Application</option></select></div>
      <div><label for="defaults-textarea">Notes</label><textarea id="defaults-textarea" rows="2"></textarea></div>
    </section>
    <table id="defaults-table">
      <caption>Inherited striped table</caption>
      <thead><tr><th scope="col">Project</th><th scope="col">Status</th></tr></thead>
      <tbody><tr><th scope="row">Website</th><td>Ready</td></tr><tr><th scope="row">Docs</th><td>In review</td></tr></tbody>
    </table>
    <figure>
      <img id="defaults-image" src="/RevaCSS/images/example-landscape.svg" width="320" height="180" alt="Hills illustration contained inside an inherited square">
      <figcaption>Inherited square ratio and contain fit.</figcaption>
    </figure>
    <section id="defaults-reset" data-size="medium" data-table="plain" data-ratio="auto" data-fit="cover" data-gap="medium" data-width="standard">
      <h2>Local exceptions</h2>
      <div class="stack" id="defaults-reset-stack">
        <button type="button" id="defaults-reset-button">Medium reset</button>
        <table id="defaults-reset-table">
          <caption>Plain reset</caption>
          <thead><tr><th scope="col">Item</th><th scope="col">State</th></tr></thead>
          <tbody><tr><th scope="row">One</th><td>Ready</td></tr><tr><th scope="row">Two</th><td>Ready</td></tr></tbody>
        </table>
        <img id="defaults-reset-image" src="/RevaCSS/images/example-landscape.svg" width="320" height="180" alt="Hills illustration at its natural ratio">
      </div>
    </section>
  </div>
</div>
</section>

For the scoped stylesheet, configure its top-level .reva boundary or a section within it. Each .reva boundary starts with its own defaults. Optional material still requires the glass stylesheet. Settings control appearance, not labels, semantic structure or interaction behavior.

Inherited and local settings

The nearest explicit setting wins. Put page-wide defaults on html; override them on a section or individual component.

HTMLSelect text to copy
<section data-accent="violet" data-shape="rounded">
  <button type="button">Inherited violet</button>
  <button type="button" data-accent="teal">Local teal</button>
</section>

data-palette

Coordinated colours for pages, surfaces, text, links, borders and primary actions. Values: default, mono, sand, ocean, cobalt, citrus, violet, forest. Default: default. Scope: inherited. See Themes / Colour palettes for every light and dark example.

Local Mono

HTMLSelect text to copy
<section data-palette="ocean" data-theme="light">
  <article class="card">
    <h3>Inherited Ocean</h3>
    <p><a href="#palette">Palette link</a></p>
    <button type="button">Primary action</button>
  </article>
  <article class="card" data-palette="mono">
    <h3>Local Mono</h3>
    <button type="button">Local action</button>
  </article>
</section>

data-theme

Page, text, links, surfaces and native controls; auto follows device colours. Default: auto. Scope: Inherited.

Auto

A local theme setting.

Light

A local theme setting.

Dark

A local theme setting.

HTMLSelect text to copy
<div class="grid">
  <section data-theme="auto"><article class="card"><h3>Auto</h3><p>A local theme setting.</p><button type="button">Action</button></article></section>
  <section data-theme="light"><article class="card"><h3>Light</h3><p>A local theme setting.</p><button type="button">Action</button></article></section>
  <section data-theme="dark"><article class="card"><h3>Dark</h3><p>A local theme setting.</p><button type="button">Action</button></article></section>
</div>

data-accent

Primary buttons and native checkbox, radio, range, progress and meter accents; links retain their readable theme colour. Default: the selected palette primary. Explicit values also install the matching primary foreground. Scope: Inherited.

HTMLSelect text to copy
<div class="grid">
  <section data-accent="blue"><button type="button">blue</button></section>
  <section data-accent="violet"><button type="button">violet</button></section>
  <section data-accent="teal"><button type="button">teal</button></section>
  <section data-accent="green"><button type="button">green</button></section>
  <section data-accent="orange"><button type="button">orange</button></section>
  <section data-accent="rose"><button type="button">rose</button></section>
</div>

data-shape

Buttons, text controls, cards, menus, disclosures, fieldsets, dialogs, popovers, tables, images, videos and code. Default: rounded. Scope: Inherited.

Square

A local shape setting.

Subtle

A local shape setting.

Rounded

A local shape setting.

Pill

A local shape setting.

HTMLSelect text to copy
<div class="grid">
  <section data-shape="square"><article class="card"><h3>Square</h3><p>A local shape setting.</p><button type="button">Action</button></article></section>
  <section data-shape="subtle"><article class="card"><h3>Subtle</h3><p>A local shape setting.</p><button type="button">Action</button></article></section>
  <section data-shape="rounded"><article class="card"><h3>Rounded</h3><p>A local shape setting.</p><button type="button">Action</button></article></section>
  <section data-shape="pill"><article class="card"><h3>Pill</h3><p>A local shape setting.</p><button type="button">Action</button></article></section>
</div>

data-fill

Button gradients and optional glass sheen. Default: gradient. Scope: Inherited.

HTMLSelect text to copy
<div class="grid">
  <section data-fill="gradient"><button type="button">gradient</button></section>
  <section data-fill="solid"><button type="button">solid</button></section>
</div>

data-density

Surface padding, control padding, table cells and layout spacing. Default: comfortable. Scope: Inherited.

Compact

A local density setting.

Comfortable

A local density setting.

Spacious

A local density setting.

HTMLSelect text to copy
<div class="grid">
  <section data-density="compact"><article class="card"><h3>Compact</h3><p>A local density setting.</p><button type="button">Action</button></article></section>
  <section data-density="comfortable"><article class="card"><h3>Comfortable</h3><p>A local density setting.</p><button type="button">Action</button></article></section>
  <section data-density="spacious"><article class="card"><h3>Spacious</h3><p>A local density setting.</p><button type="button">Action</button></article></section>
</div>

data-depth

Buttons, cards, fieldsets, disclosures, dialogs, popovers, menus and desktop panels; control inset shadows use data-controls. Default: subtle. Scope: Inherited.

Flat

A local depth setting.

Subtle

A local depth setting.

Pronounced

A local depth setting.

HTMLSelect text to copy
<div class="grid">
  <section data-depth="flat"><article class="card"><h3>Flat</h3><p>A local depth setting.</p><button type="button">Action</button></article></section>
  <section data-depth="subtle"><article class="card"><h3>Subtle</h3><p>A local depth setting.</p><button type="button">Action</button></article></section>
  <section data-depth="pronounced"><article class="card"><h3>Pronounced</h3><p>A local depth setting.</p><button type="button">Action</button></article></section>
</div>

data-motion

Button transitions, press movement and decorative edge animation; reduced-motion preference wins. Default: subtle. Scope: Inherited.

HTMLSelect text to copy
<div class="grid">
  <section data-motion="none"><button type="button">none</button></section>
  <section data-motion="subtle"><button type="button">subtle</button></section>
  <section data-motion="expressive"><button type="button">expressive</button></section>
</div>

data-type

Page and subtree typography. Default: standard. Scope: Inherited.

Compact

A local type setting.

Standard

A local type setting.

Large

A local type setting.

HTMLSelect text to copy
<div class="grid">
  <section data-type="compact"><article class="card"><h3>Compact</h3><p>A local type setting.</p><button type="button">Action</button></article></section>
  <section data-type="standard"><article class="card"><h3>Standard</h3><p>A local type setting.</p><button type="button">Action</button></article></section>
  <section data-type="large"><article class="card"><h3>Large</h3><p>A local type setting.</p><button type="button">Action</button></article></section>
</div>

data-border

Styled control and surface borders, table rules and menu panel separators; invalid and forced-colour boundaries win. Default: subtle. Scope: Inherited.

Subtle

A local border setting.

Defined

A local border setting.

None

A local border setting.

HTMLSelect text to copy
<div class="grid">
  <section data-border="subtle"><article class="card"><h3>Subtle</h3><p>A local border setting.</p><button type="button">Action</button></article></section>
  <section data-border="defined"><article class="card"><h3>Defined</h3><p>A local border setting.</p><button type="button">Action</button></article></section>
  <section data-border="none"><article class="card"><h3>None</h3><p>A local border setting.</p><button type="button">Action</button></article></section>
</div>

data-contrast

Readable text and boundary colours; optional glass becomes opaque; device high-contrast preference wins. Default: auto. Scope: Inherited.

Auto

A local contrast setting.

More

A local contrast setting.

HTMLSelect text to copy
<div class="grid">
  <section data-contrast="auto"><article class="card"><h3>Auto</h3><p>A local contrast setting.</p><button type="button">Action</button></article></section>
  <section data-contrast="more"><article class="card"><h3>More</h3><p>A local contrast setting.</p><button type="button">Action</button></article></section>
</div>

data-tone

Neutral, cool or warm page and surface backgrounds. Default: the selected palette surfaces. Explicit values change surfaces without resetting palette foregrounds or primary colours. Scope: Inherited.

Neutral

A local tone setting.

Cool

A local tone setting.

Warm

A local tone setting.

HTMLSelect text to copy
<div class="grid">
  <section data-tone="neutral"><article class="card"><h3>Neutral</h3><p>A local tone setting.</p><button type="button">Action</button></article></section>
  <section data-tone="cool"><article class="card"><h3>Cool</h3><p>A local tone setting.</p><button type="button">Action</button></article></section>
  <section data-tone="warm"><article class="card"><h3>Warm</h3><p>A local tone setting.</p><button type="button">Action</button></article></section>
</div>

data-controls

Text input, select and textarea fill and inset shadow. Default: styled. Scope: Inherited.

HTMLSelect text to copy
<div class="grid">
  <section data-controls="styled"><label for="attr-controls-styled">styled field</label><input id="attr-controls-styled" placeholder="Project name"></section>
  <section data-controls="minimal"><label for="attr-controls-minimal">minimal field</label><input id="attr-controls-minimal" placeholder="Project name"></section>
</div>

data-width

Content width of .container. Default: standard. Scope: Inherited; affects .container.

narrow container
standard container
wide container
HTMLSelect text to copy
<div class="stack">
  <section data-width="narrow"><div class="container"><article class="card">narrow container</article></div></section>
  <section data-width="standard"><div class="container"><article class="card">standard container</article></div></section>
  <section data-width="wide"><div class="container"><article class="card">wide container</article></div></section>
</div>

data-table

Table stripes and grid lines; grid thickness follows data-border. Default: plain. Scope: Inherited; affects tables.

plain
ItemState
OneReady
TwoReview
striped
ItemState
OneReady
TwoReview
bordered
ItemState
OneReady
TwoReview
HTMLSelect text to copy
<div class="grid">
  <section data-table="plain"><table><caption>plain</caption><thead><tr><th scope="col">Item</th><th scope="col">State</th></tr></thead><tbody><tr><th scope="row">One</th><td>Ready</td></tr><tr><th scope="row">Two</th><td>Review</td></tr></tbody></table></section>
  <section data-table="striped"><table><caption>striped</caption><thead><tr><th scope="col">Item</th><th scope="col">State</th></tr></thead><tbody><tr><th scope="row">One</th><td>Ready</td></tr><tr><th scope="row">Two</th><td>Review</td></tr></tbody></table></section>
  <section data-table="bordered"><table><caption>bordered</caption><thead><tr><th scope="col">Item</th><th scope="col">State</th></tr></thead><tbody><tr><th scope="row">One</th><td>Ready</td></tr><tr><th scope="row">Two</th><td>Review</td></tr></tbody></table></section>
</div>

data-size

Buttons, inputs, selects, textareas, .button links and menu actions; native touch target minimums remain. Default: medium. Scope: Inherited; affects controls and menu actions.

HTMLSelect text to copy
<div class="row">
  <section data-size="small"><button type="button">small</button></section>
  <section data-size="medium"><button type="button">medium</button></section>
  <section data-size="large"><button type="button">large</button></section>
</div>

data-ratio

Image and video aspect ratio; auto retains natural proportions. Default: auto. Scope: Inherited; affects images and videos.

Hills illustration, auto example
auto
Hills illustration, square example
square
Hills illustration, landscape example
landscape
Hills illustration, portrait example
portrait
Hills illustration, wide example
wide
HTMLSelect text to copy
<div class="grid">
  <figure data-ratio="auto"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" alt="Hills illustration, auto example"><figcaption>auto</figcaption></figure>
  <figure data-ratio="square"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" alt="Hills illustration, square example"><figcaption>square</figcaption></figure>
  <figure data-ratio="landscape"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" alt="Hills illustration, landscape example"><figcaption>landscape</figcaption></figure>
  <figure data-ratio="portrait"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" alt="Hills illustration, portrait example"><figcaption>portrait</figcaption></figure>
  <figure data-ratio="wide"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" alt="Hills illustration, wide example"><figcaption>wide</figcaption></figure>
</div>

data-fit

Image and video content within constrained dimensions. Default: cover. Scope: Inherited; affects constrained images and videos.

Hills illustration, cover example
cover
Hills illustration, contain example
contain
HTMLSelect text to copy
<div class="grid">
  <figure data-fit="cover"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" data-ratio="square" alt="Hills illustration, cover example"><figcaption>cover</figcaption></figure>
  <figure data-fit="contain"><img src="/RevaCSS/images/example-landscape.svg" width="640" height="360" data-ratio="square" alt="Hills illustration, contain example"><figcaption>contain</figcaption></figure>
</div>

data-gap

Spacing in .grid, .row and .stack; combines with density. Default: medium. Scope: Inherited; affects .grid, .row and .stack.

none gap
Second item
small gap
Second item
medium gap
Second item
large gap
Second item
HTMLSelect text to copy
<div class="grid">
  <section data-gap="none"><div class="stack"><article class="card">none gap</article><article class="card">Second item</article></div></section>
  <section data-gap="small"><div class="stack"><article class="card">small gap</article><article class="card">Second item</article></div></section>
  <section data-gap="medium"><div class="stack"><article class="card">medium gap</article><article class="card">Second item</article></div></section>
  <section data-gap="large"><div class="stack"><article class="card">large gap</article><article class="card">Second item</article></div></section>
</div>

data-edge

Decorative gradient border; shine sweeps on hover/focus, animated turns continuously; motion, border and contrast settings apply. Native input buttons retain regular borders. Default: plain. Scope: Inherited; affects buttons, .button links and .card.

HTMLSelect text to copy
<div class="row">
  <button type="button" data-edge="plain">Plain</button>
  <button type="button" data-edge="gradient">Gradient</button>
  <button type="button" data-edge="shine">Shine</button>
  <button type="button" data-edge="animated">Animated</button>
</div>

data-material

Buttons, button links, native action inputs and supported surfaces; glass requires the optional stylesheet; solid stops inherited glass. Default: solid. Scope: Inherited material scope; optional glass stylesheet.

Solid

A local material setting.

Glass

A local material setting.

HTMLSelect text to copy
<div class="grid">
  <section data-material="solid"><article class="card"><h3>Solid</h3><p>A local material setting.</p><button type="button">Action</button></article></section>
  <section data-material="glass"><article class="card"><h3>Glass</h3><p>A local material setting.</p><button type="button">Action</button></article></section>
</div>

data-variant

Inherited semantic colour for buttons, action inputs, .button links, badges and alerts. Default: primary. Local action attributes override parent settings; existing semantic button classes remain local overrides unless the action supplies a valid variant.

Approved
Success: Your changes have been saved.
HTMLSelect text to copy
<section class="stack" data-variant="success">
  <div class="row">
    <button type="button">Confirm</button>
    <span class="badge">Approved</span>
    <button type="button" data-variant="danger">Delete</button>
  </div>
  <div class="alert">Success: Your changes have been saved.</div>
</section>

data-appearance

Inherited badge and alert appearance. Place this setting on html or a parent; children only need their component class. Default: tinted.

Tinted
Solid
Outline
HTMLSelect text to copy
<div class="row">
  <section data-appearance="tinted">
    <span class="badge">Tinted</span>
  </section>
  <section data-appearance="solid">
    <span class="badge">Solid</span>
  </section>
  <section data-appearance="outline">
    <span class="badge">Outline</span>
  </section>
</div>