-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Interactive Surface CSS exposes a class-based API. The package is intentionally small and does not ship JavaScript behavior beyond importing the stylesheet.
Base interaction primitive. Apply this class to any interactive host element that should receive the package's shared state behavior.
Provides:
- base surface appearance
- hover elevation
- focus-visible ring
- pressed feedback
- active/toggled styling
- disabled handling
Reduces hover and active lift values and uses a smaller shadow profile.
Increases hover and active lift values and uses a larger shadow profile.
There is no .size-md class requirement. Medium behavior is the base default when no size modifier is applied.
Applies the active/toggled state styling.
Applies disabled styling and disables interaction by setting pointer-events: none.
Receives the same active styling as .is-active.
Receives the same visual disabled styling as .is-disabled (reduced opacity, no transform or shadow, cursor: not-allowed, pointer-events: none). Unlike native :disabled controls, [aria-disabled="true"] elements can still receive keyboard focus, so the focus ring remains visible when the element is focused via Tab.
Native disabled controls also receive disabled styling.
These classes only tune brightness behavior. They do not define complete color themes by themselves.
.variant-primary.variant-secondary.variant-accent.variant-subtle.variant-warning.variant-danger
These are best understood as behavioral modifiers layered on top of your own theme tokens.
Optimizes the host element for icon-only controls.
Behavior includes:
- 44px minimum width
- 44px minimum height
- centered inline-flex layout
- adjusted lift and shadow profile
- tighter radius profile
The CSS state model is:
- base
- hover / focus-visible
- active / toggled
- press
- disabled
interactive-surface-cssinteractive-surface-css/interactive-surface.cssinteractive-surface-css/package.json-
interactive-surface-css/index.html(primary demo/customization app) -
interactive-surface-css/example.html(backward-compatible alias toindex.html)
This package does not provide:
- JavaScript state management
- component rendering helpers
- framework bindings
- layout utilities
- global design tokens