Skip to main content
technical

Tailwind CSS 4 in Production: Tips from Building a Healthcare Marketplace

·Pablo Diaz·Founder & CEO, Blossend Inc

Find your perfect provider in 33 seconds. 150K+ patients already have.

No insurance needed. No waiting weeks. Book today.

150K+ users · Ex-Amazon Engineer · Healthcare Innovation

No card charged today · 33-second booking · HIPAA compliant

Tailwind CSS 4 is a significant upgrade that we adopted early for OpenMyPro. The new CSS-first configuration, improved performance, and modern features make it the right choice for production applications. Here are our production tips from using Tailwind 4 across a healthcare marketplace serving 150K+ users.

The @theme Directive Changes Everything

Tailwind 4 replaced JavaScript configuration files with a CSS-native @theme directive. Our globals.css defines our entire design system in pure CSS using custom properties. Brand colors, surface colors, typography — all defined in one place and available throughout the application.

This approach is superior to the old tailwind.config.js because design tokens are now actual CSS variables, accessible to both Tailwind utility classes and custom CSS. When we need a color in a dynamic style attribute, we use var(--color-brand) directly. No JavaScript imports needed.

Dark Theme Pattern

Healthcare applications should offer dark themes for several reasons: reduced eye strain during long browsing sessions, accessibility for light-sensitive users, and the professional aesthetic that builds trust. OpenMyPro uses a dark theme throughout, and Tailwind 4 makes this straightforward.

Our pattern uses the @theme directive for all colors with a dark palette as the default. We pair Tailwind utility classes with inline style props for critical text elements, ensuring white text is always visible on dark backgrounds. For example, style={{ color: '#ffffff' }} as a backup ensures text visibility even if Tailwind classes fail to load.

The key lesson is redundancy. Do not rely solely on Tailwind classes for critical contrast ratios. Inline styles provide a safety net that guarantees readability. In healthcare, unreadable text is not just a design issue — it is an accessibility and safety issue.

Component Patterns for Scalability

With 50+ pages and dozens of shared components, we developed patterns that keep Tailwind manageable at scale. First, we use consistent spacing and sizing across all components. Cards always use p-6, sections use py-12 or py-16, and max-width containers use max-w-3xl, max-w-4xl, or max-w-6xl depending on content type.

Second, border-color consistency. We use border-zinc-400 for primary borders and border-zinc-800 for secondary borders throughout the application. This consistency creates visual harmony that patients notice subconsciously, even if they cannot articulate why the interface feels professional.

Third, interaction patterns. All interactive elements use transition-colors duration-200 for hover effects. Buttons use rounded-lg or rounded-xl depending on prominence. Links use text-cyan-400 for brand color with hover:text-cyan-300. These consistent patterns create a cohesive experience.

Performance Optimization

Tailwind 4 generates CSS at build time using a Rust-based engine, producing smaller CSS bundles than previous versions. Our entire application's CSS is under 30KB gzipped. This contributes to our sub-800ms First Contentful Paint.

We avoid dynamic class generation, which can cause Tailwind to miss classes during the build scan. All class names are written as complete strings, never constructed dynamically. Instead of using template literals to build class names, we use conditional logic with complete class strings. This ensures the build scanner finds every class and includes it in the output.

Accessibility With Tailwind

WCAG compliance is non-negotiable for healthcare. Tailwind 4 provides utilities that support accessibility, but you must use them deliberately. Every interactive element needs focus-visible styles for keyboard navigation. Color contrast must meet WCAG AA minimum of 4.5:1 for text.

Our text uses zinc-300 on a dark background, which provides a contrast ratio above 7:1 — exceeding AA standards. Interactive elements use focus-visible:ring-2 focus-visible:ring-cyan-500 for clear keyboard focus indicators. Form inputs use aria-label and aria-describedby attributes that pair with Tailwind styling.

Tailwind 4 has been a productivity multiplier for building OpenMyPro. The CSS-native configuration, dark theme support, and build performance make it ideal for production healthcare applications. See our Tailwind-powered design at openmypro.com. Check out noizz.io for brand discovery with the same design system.

Ready to find the right AI tool? Our AI matching finds it in 33 seconds.

Skip the wait. Book a therapist in 33 seconds.

150K+ users · Ex-Amazon Engineer · Healthcare Innovation

No card charged today · AI-powered matching · 33-second booking

Frequently Asked Questions

What is new in Tailwind CSS 4?

Tailwind 4 introduces CSS-native configuration with the @theme directive (replacing JavaScript config files), a Rust-based build engine for faster compilation, modern CSS features like bg-linear-to-* gradients, and improved developer experience. Design tokens become real CSS custom properties.

How do you handle dark mode with Tailwind CSS 4?

Define dark palette colors in the @theme directive as defaults. Use inline style={{ color: '#ffffff' }} as a backup for critical text to ensure visibility. Maintain consistent border colors (border-zinc-400 minimum) for adequate contrast on dark backgrounds.

Is Tailwind CSS good for healthcare applications?

Yes. Tailwind's utility-first approach enables consistent, accessible design at scale. OpenMyPro uses Tailwind 4 for its entire healthcare marketplace with WCAG-compliant contrast ratios, keyboard navigation support, and professional typography — all in under 30KB gzipped CSS.

Join 150K+ people who found their provider. Start free today.

150K+ users trust OpenMyPro. Book in 33 seconds — not 26 days.

150K+ users · Ex-Amazon Engineer · Healthcare Innovation

No card charged today · Cancel anytime · HIPAA compliant

Recommended

Track how brands rank

Noizz monitors 5,000+ companies with real-time brand analytics.

Explore Noizz

Get Founder Insights Weekly

Startup lessons, technical deep dives, and behind-the-scenes of building a 14-platform ecosystem. No spam.

PD

Pablo Diaz

Founder & CEO, Blossend Inc

Ex-Amazon AWS engineer turned 2x founder. Built OpenMyPro healthcare marketplace serving 150K+ users. CEO of Blossend Inc. Building the future of healthcare discovery.

OpenMyPro connects you with healthcare providers for instant appointments. Try it free →

Build your professional portfolio

Free to get started. No card charged today.

Get Started

You might also like

Building a HIPAA-Compliant App with Next.js: Practical Architecture Guide

How we built OpenMyPro as a HIPAA-compliant healthcare app using Next.js, Supabase, and Vercel. Real architecture decisi...

Building a Startup with Supabase and Vercel: My Production Stack Review

Honest review of building OpenMyPro with Supabase and Vercel. What works, what does not, performance data, and why this ...

Next.js App Router in Production: Lessons from 150K+ Users

Real production lessons from running Next.js App Router at scale with 150K+ users. Server Components, performance, gotch...

Tools We Recommend

Find healthcare providers

AI-powered matching. Book a provider in 33 seconds.

Try OpenMyPro

Discover trending brands

Product Hunt-style brand discovery with AI insights.

Explore Brands

AI-Powered Healthcare Tech

The parent company behind OpenMyPro and the Blossend ecosystem.

Learn More

Ready to work together? Get in touch or explore our platforms.

More tools by the same team

Find Healthcare Providers Instantly

AI-powered matching. Book a therapist, trainer, or nutritionist in 33 seconds.

Try OpenMyPro Free

Work With Me

Get updates on new projects, tools, and tech insights.

No spam. Unsubscribe anytime.

Visit Blossend.com →

Explore the full portfolio of independent AI tools and editorial properties at blossend.com.