OPTIONAL ACTION MATERIAL / 1.2 DEVELOPMENT PREVIEW

Button materials

Choose a finish for actions while cards, menus and text fields keep their own material. Configure the page once, then override only exceptions.

These pages describe RevaCSS 2.0.0 in development. Use the documentation build for a preview or build the stylesheets from source.

The Veil button finish is deprecated. It remains available for compatibility; choose Solid, Glass, Soft UI or Liquid for new actions.

Six finishes, one attribute

These examples follow this page’s theme. Solid, Glass, Veil and Soft use its action colours; Liquid stays neutral and shows the background through its surface. Use Customize → Surfaces → Button material to try the setting across documentation and demos. Navigation toggles and dropdown controls keep their existing appearance and hover treatment.

default

Follow the surrounding material.

solid

Opaque semantic colour.

glass

Frosted, translucent colour.

veil

Deprecated; retained for existing interfaces.

soft

Paired raised and inset shadows.

liquid

Clear, neutral glass with fluid press feedback.

Load the optional module

Load reva.button-materials.css after the complete core. It includes all five explicit finishes; load the general Glass, Veil or Soft UI extensions only when you also need those materials on other surfaces. Omitted or default button material preserves the surrounding material.

HTMLSelect text to copy
<!doctype html>
<html lang="en" data-material="soft" data-button-material="liquid" data-motion="subtle">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Independent button materials</title>
  <link rel="stylesheet" href="reva.css">
  <link rel="stylesheet" href="reva.soft.css">
  <link rel="stylesheet" href="reva.button-materials.css">
</head>
<body>
  <article class="card"><h1>Your project</h1><button type="button">Save changes</button></article>
</body>
</html>

For scoped use, load reva.scoped.css and reva.button-materials.scoped.css, and configure data-button-material on .reva or within it. Modular applications load tokens, base and this extension, plus any structural modules used by their markup.

Inherited choices and local resets

An explicit button finish applies through general material boundaries. Default stops that finish and follows the general material at each action; a new local choice can resume it.

Soft card, liquid actions

HTMLSelect text to copy
<section data-material="soft" data-button-material="liquid" class="stack">
  <article class="card"><h3>Soft card, liquid actions</h3><div class="row">
    <button type="button">Continue</button>
    <button type="button" data-button-material="solid">Solid exception</button>
    <button type="button" data-button-material="default">Follow Soft UI</button>
  </div></article>
  <section data-button-material="default" data-material="glass">
    <button type="button">Follow Glass</button>
    <button type="button" data-button-material="liquid">Liquid again</button>
  </section>
</section>

The same finish on every action type

Native button and button/submit/reset inputs, .button links and .scroll-top actions share the material. Navigation toggles, dropdown controls, text fields, switches, checkboxes, cards and ordinary links keep their own styles.

Button link Back to top
HTMLSelect text to copy
<section data-button-material="liquid" class="row">
  <button type="button">Native button</button>
  <input type="button" value="Native input action">
  <a class="button" href="#install">Button link</a>
  <a class="scroll-top" href="#page-top">Back to top</a>
</section>

Clear glass over a patterned background

The stripes remain visible through Liquid. Its neutral backing and white reflection add no accent colour; colours beneath the glass can still show through.

HTMLSelect text to copy
<section data-button-material="liquid" style="padding: 2rem; background: repeating-linear-gradient(115deg, var(--re-surface-alt) 0 2rem, var(--re-bg) 2rem 4rem)">
  <button type="button">Transparent glass</button>
</section>

Press and return

Liquid uses transparent neutral backing, reflective rims and backdrop blur to suggest clear glass. Pressing gently expands it; release returns it with elastic easing. This is a CSS simulation, with a fixed highlight rather than a reflection that tracks your finger.

none

subtle

expressive

MotionPressReturn
noneImmediate highlight; no expansionImmediate
subtle1.025 × 1.015 scale; 140ms280ms elastic easing
expressive1.045 × 1.02 scale; 240ms480ms elastic easing

Reduced motion removes expansion and transitions. Expansion uses transforms, so it does not reflow neighbouring content; leave enough surrounding space and avoid clipping the button’s rim or focus outline. Press feedback follows native :active. Keyboard activation and focus remain native; browsers that do not expose active state during a keyboard press activate the action without the expansion.

Numeric customization

CSSSelect text to copy
html {
  --re-liquid-scale-x: 1.035;
  --re-liquid-scale-y: 1.015;
  --re-liquid-blur: 10px;
  --re-liquid-opacity: 12%;
}

Scale values are positive numbers, blur is a nonnegative length and neutral backing opacity is a percentage, defaulting to 12%. Place overrides on the same configured boundary or on an action. A local motion preset installs its own scale defaults. Motion none and reduced motion suppress expansion even with custom scale values. Review text contrast over photos or custom backgrounds: transparent glass cannot guarantee readable labels over every image. Use an opaque finish or More Contrast when the background makes a label hard to read.

Preferences and limits

  • Solid, Glass, Veil and Soft retain semantic colours. Liquid uses the theme’s normal text colour and neutral glass for every variant; use clear action labels, or choose Solid when a coloured action is needed. Shape, size, density, borders and depth remain separate settings. Outline and ghost actions retain transparent backing and their own borders; liquid motion can still apply.
  • Increased contrast and reduced transparency simplify decorative paint and use opaque backing. Explicit More Contrast disables blur and decoration. Forced colours and print use plain accessible paint and remove movement.
  • Browsers without backdrop filtering retain opaque backing; Liquid’s fallback stays neutral. Browsers without linear() easing use the cubic Bézier fallback.
  • Native focus outlines and activation remain intact. Disabled controls do not expand; aria-disabled describes state but application code must prevent an unavailable link or action from activating.
  • Liquid adds no optical refraction, finger tracking, haptics or framework JavaScript. RevaCSS does not reproduce Apple’s native rendering engine.

Standards: CSS scopes and cascade, CSS easing and native active state.