When people build an admin dashboard today, the first step is usually "pick a framework". I wanted to try the opposite: Tailwind CSS v4, plain HTML and one small vanilla JavaScript file . The result is Velora, a 19-page dashboard template. Here are the patterns that made it work.
👉 Live demo
1. Dark mode without a flash
Tailwind v4 lets you redefine the dark variant directly in CSS:
@import "tailwindcss" ; @custom-variant dark ( & : where ( .dark , .dark * ) ) ;
Enter fullscreen mode
Exit fullscreen mode
Now dark:bg-gray-900 applies whenever an ancestor has the dark class. To avoid the classic "white flash" on page load, a tiny script in the <head> applies the saved theme before anything is painted:
<script> try { var t = localStorage . getItem ( "velora-theme" ) ; if ( t === "dark" || ( ! t && matchMedia ( "(prefers-color-scheme: dark)" ) . matches ) ) document . documentElement . classList .…