Styling
The example uses daisyUI on Tailwind CSS 4.
src/app.css is the whole setup:
@import "tailwindcss";
@plugin "daisyui";
The @tailwindcss/vite plugin in vite.config.ts builds it. Tailwind finds the class names in your .tsx
files by itself, and there is no tailwind.config.js.
Writing markup
- Reach for a daisyUI component first (
btn,card,navbar,listwithlist-row,join,stats,alert,modal), then Tailwind utilities for layout and spacing (flex,gap-2,p-4). - Take colors from the theme:
bg-base-100,bg-base-200,text-base-content/60,btn-primary,text-error. They change with the theme, and fixed colors such astext-gray-800do not. Never usedark:. - Use
primaryfor the one most important action on a page.
Components: https://daisyui.com/components/ • Colors: https://daisyui.com/docs/colors/
Themes
Light or dark follows the device, everywhere, with nothing to write:
- The web app: daisyUI ships
lightanddarkand picks by the system's setting (prefers-color-scheme). - The phone apps: their native bars follow the phone, on iOS by default and on Android through the
Theme.Material3.DayNighttheme, and the page in them follows the same setting. Bars and page always match.
The About page also has a switch: System, Light or Dark. POST /theme keeps the choice in a cookie
(src/theme.ts), and the layout puts it on <html data-theme>, which daisyUI reads, so each
page has it from the server, with no flash of the other theme. The layout also hands it to the phone apps
(<meta data-controller="bridge--theme">, the "theme" bridge component, Hotwire Native),
whose bars and screens take it, so bars and page still match. A switch in CSS alone would leave the apps' bars behind.
Check it on the About page, or by switching the device with "System" chosen: System Settings → Appearance on the
Mac, xcrun simctl ui booted appearance dark for the iOS simulator, adb shell cmd uimode night yes for the Android
emulator (light and no switch back). flows/about.yaml chooses dark and goes back, in a browser and in both apps.
To pick other themes, see https://daisyui.com/docs/themes/ (@plugin "daisyui" { themes: … }).
Fonts
System fonts only, again with nothing to write: Tailwind's default font-sans is a list of them
(-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, …, sans-serif). The page shows in SF on an iPhone and a
Mac, in Roboto on Android and in Segoe UI on Windows, so in the phone apps it has the native bars' font. Add no web
font, no @font-face and no font service: the native bars would not use it, and every page would wait for it.
Check: grep -rn font-face src finds nothing, and neither phone app bundles a font.
CSS of your own
Add to src/app.css only what classes cannot say. The example's only rule hides a web control when a phone
app draws it natively (Hotwire Native).