Skip to content
Back to Knowledge Base

How to Use DaisyUI for Theming

CoCoCo’s Custom App runtime includes DaisyUI — a component library on Tailwind CSS. DaisyUI’s semantic classes automatically adapt to the platform’s light and dark theme.

Always use DaisyUI semantic classes for colors and backgrounds. Never hardcode color values for UI chrome.

<!-- Correct -->
<div class="bg-base-100 text-base-content border border-base-300">
<!-- Avoid -->
<div style="background: white; color: black;">
ClassMaps to
bg-base-100Page background
bg-base-200Elevated surface (cards, panels)
text-base-contentPrimary text color
border-base-300Standard border
bg-primaryBrand primary color
text-primary-contentText on primary background
bg-errorError state
<button class="btn btn-primary">Save</button>
<div class="badge badge-success">Active</div>
<div class="alert alert-warning">Check this setting</div>
<input class="input input-bordered w-full" />

DaisyUI reads the dark class on the iframe’s html element automatically. Use semantic classes and theming works in both modes — no JavaScript needed.