DocsHTML & CSS
Get started

Search Subtly documentation

Search by a task, helper name or framework.

HTML & CSS

CSS utilities

Use data attributes for behavior, classes for structural styling, and your own design tokens for appearance.

JavaScript
import "subtly/styles.css";

Available classes

CSS
/* Optional opt-in styles. No global resets or theme assumptions. */
.ix-sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
/* Prefer a real 44px target rather than overlapping invisible targets. */
.ix-hit-target {
min-inline-size: 44px;
min-block-size: 44px;
display: inline-grid;
place-items: center;
}
.ix-scroll-contained {
overscroll-behavior: contain;
}
.ix-stable-scrollbar {
scrollbar-gutter: stable;
}
.ix-error-slot {
min-block-size: 1.5em;
}
/* Apply to a positioned trigger only when the gap does not cover other controls. */
.ix-hover-bridge {
position: relative;
}
.ix-hover-bridge::after {
content: "";
position: absolute;
inset-inline: 0;
inset-block-start: 100%;
block-size: var(--ix-bridge-gap, 8px);
}
.ix-skeleton {
background: var(--ix-skeleton-bg, #8882);
border-radius: var(--ix-skeleton-radius, 6px);
}
.ix-motion {
transition-duration: var(--ix-duration, 180ms);
transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
.ix-motion {
transition-duration: 0ms;
animation-duration: 0ms;
}
}

Native CSS first

Use focus-visible, scroll-margin, overscroll-behavior, aspect-ratio and reduced-motion media queries before adding JavaScript.