How OnchainKit v1.0.0 styling and theming works
mainOnchainKit v1.0.0 uses a scoped styling system built with Tailwind CSS v4. Styles are self-contained and designed to prevent conflicts with your application's theme.
Scoped Styles
- Class Prefixing: All OnchainKit classes are prefixed with
ock:. - Theme Variables: Custom CSS properties use the
--ock-prefix. - Data Attributes: Theming is controlled via the
data-ock-themeattribute on an element (typically<html>).
Custom Theming
If you are customizing OnchainKit themes, you must migrate your CSS variables to use the --ock- prefix and apply them within a [data-ock-theme] selector.
/* After (v1.0) */
[data-ock-theme='custom'] {
--ock-text-foreground: #000000;
--ock-background: #ffffff;
}To apply a theme:
<html data-ock-theme="default-dark">
{/* Your app content */}
</html>