prefers‑color‑scheme Live Preview - Online Dark/Light
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
UD5 Toolkit
Design light & dark mode themes with CSS custom properties — live preview, instant export
Your project metrics are looking great this week.
-- prefix. They allow you to store colors, spacing, fonts, and other design tokens in one place. For theming, they're ideal because you can define different values for [data-theme="light"] and [data-theme="dark"] selectors, enabling instant theme switching without JavaScript overhead. They're natively supported in all modern browsers and cascade naturally through the DOM.
data-theme attribute on your <html> or <body> element. You can use JavaScript: document.documentElement.setAttribute('data-theme', 'dark') to switch themes. For persistence, save the user's preference in localStorage and apply it on page load. The CSS cascade handles the rest — all elements using var(--your-variable) will update automatically.
--bs-primary, --bs-body-bg). You can override Bootstrap's default variables with your own theme values. For Tailwind CSS, you can reference CSS variables in your tailwind.config.js or use them directly in utility classes via arbitrary values. This builder exports standard CSS variables that work seamlessly with any framework.
localStorage: localStorage.setItem('theme', 'dark')window.matchMedia('(prefers-color-scheme: dark)') as a default, then let them override it. This builder's output works perfectly with such a setup.
#000) backgrounds — use dark grays like #1a1a2e to reduce eye strain. (3) Don't just invert colors — adjust saturation and brightness thoughtfully. (4) Ensure focus indicators remain visible. (5) Test with real content. This builder's presets follow these principles to give you a solid starting point.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Visually name grid areas in a table and generate grid‑template‑areas CSS. Perfect for complex layouts. Drag‑free.
Create glowing, neon‑style text effects with multiple text‑shadows. Adjust colors and intensity. Copy the CSS.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
Apply the drop‑shadow() filter and compare it with box‑shadow. See how it follows the contour of transparent images. Copy code.
Create vertically oriented text layouts with `writing‑mode`. See the effect and copy the complete CSS. For vertical languages.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Create a rainbow gradient text animation using pure CSS. Customize speed and colors. Copy the code for your website.
Visually create the glassmorphism effect: background blur, transparency, and border. Copy the complete CSS. Modern UI design.
Paste your full CSS and HTML; automatically identify and extract the styles needed for the visible part. Reduce render‑blocking resources.
Create a 5‑star rating widget using only HTML and CSS. Customize colors and size. Copy the clean code.
Build a complete font‑stack for your website. Choose a primary font and get the best fallback options for different OS. Copy the CSS.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create seamless CSS background patterns like stripes, polka dots, checkerboard. Adjust size and colors. Copy the tiny CSS.
Stack multiple background images and blend them with colors. Create unique textures. Copy the CSS code instantly.
Create outlined text with the text‑stroke property. Adjust width and color. Preview and copy the CSS.
Simulate forced‑colors mode and see how your site looks. Adjust CSS system colors. Make your design accessible.
See how grid-auto-flow: row vs column changes item placement. Add and remove items to understand the algorithm. Visual.
Toggle OpenType features like liga, smcp, tnum, and see the text update. Support for variable fonts. Typography nerds.
Style the first letter of a paragraph as a large decorative drop cap. Choose font, color, and size. Get the CSS & HTML.
Paste your CSS and sort the properties of each rule alphabetically or by concentric groups. Keep your stylesheets consistent without a build step.
Apply content‑visibility: auto to off‑screen sections and see the rendering cost drop. Demos for infinite scroll optimization.
Create a frosted glass card with background blur, border glow, and shadow. Adjust intensity. Copy the CSS.
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
Drag and drop light sources, camera, and subject to plan a photo shoot. Export diagram as image. Simple and visual.
Select emojis and arrange them into a seamless tiling background. Copy the CSS data‑URI or download as image.
Generate a palette of N colors that are maximally distinguishable for common color vision deficiencies. Copy the hex codes.