Frontend technology
Tailwind CSS development.
At a glance
How I use Tailwind CSS in real projects.
- Consistent spacing and type across pages
- Responsive layout variants without separate stylesheets
- Theme tokens for light and dark modes
Overview
What it is and why it matters.
Tailwind CSS moves styling decisions into the markup while keeping them tied to a constrained set of tokens. Used with discipline, it makes responsive states and theme changes visible at the point of use and reduces the drift that comes from scattered one-off CSS.
The design tokens are configured first: colours, spacing, type scale and breakpoints. Components use those tokens rather than arbitrary values, and repeated patterns are extracted into components when the repetition becomes real. Custom CSS is kept for things utilities do not express well.
Practical examples
Seen in real builds.
A component library built with Tailwind starts from the config: brand colours, semantic tokens, spacing scale and breakpoints are defined once. Buttons, cards and fields then compose those tokens, so a design change is a config edit rather than a hunt through stylesheets.
The dark-mode workflow demonstrates the discipline: every colour in a component is a semantic token with a dark variant, so a theme switch never produces a one-off patch. Arbitrary values appear only for genuinely one-off cases, and even then they are documented.
How it works
Under the surface.
Tailwind generates utility classes from a configured design token set. Markup declares styles directly, and the build emits only the classes actually used, keeping the stylesheet proportional to the interface rather than to the framework.
Advantages
- Design decisions live beside the markup that uses them
- Token configuration enforces consistent spacing, colour and type
- Responsive and theme variants are explicit at the point of use
- Purge-based output keeps production CSS small
Limitations
- Long class lists need component extraction to stay readable
- Arbitrary values can silently bypass the token system
- Team conventions matter more than the tool itself
- Custom design systems still require real design decisions
Best practices
How it is used well.
- Configure tokens first and treat arbitrary values as exceptions
- Extract repeated patterns into components when repetition is real
- Keep dark-mode variants mapped to the same semantic tokens
- Agree ordering conventions so diffs stay reviewable
Common mistakes
Where projects drift.
- One-off arbitrary values that quietly fork the design system
- Copy-pasted class strings drifting between components
- Hiding structural problems behind utilities
- Skipping contrast checks in theme variants
In practice
Where Tailwind CSS fits.
Consistent spacing and type across pages
Responsive layout variants without separate stylesheets
Theme tokens for light and dark modes
Fast iteration on component-level design
Security
Tailwind output is presentational only; the usual HTML sanitisation rules apply to anything dynamic in class names.
Performance
The purged stylesheet stays small; runtime cost is essentially the browser’s normal CSS work.
Related services
Where this stack is used.
Frontend Development
Responsive, accessible front ends built with React, TypeScript and modern CSS, connected cleanly to real data.
ExploreResponsive Website Development
Websites that remain readable, usable and fast from small phones to wide desktop displays.
ExploreWebsite Redesign
A structured redesign that improves clarity, usability and performance while protecting existing content and search visibility.
ExploreRelated technologies
Questions
Tailwind CSS questions.
Does Tailwind make HTML messy?
It can if it is used without a system. I keep class lists tied to tokens and extract repeated patterns into components, which keeps the markup readable and consistent.
Can Tailwind be used without React?
Yes. It works with plain HTML, server-rendered templates and other frameworks. The build setup differs, but the token approach is the same.
How are custom designs handled?
The design is translated into tokens and component patterns first. Tailwind is the styling tool, not a substitute for design decisions.
Is Tailwind suitable for large applications?
Yes, when conventions hold: token-based classes, extracted components and agreed ordering. The failure mode is not the tool but the absence of conventions.
Can Tailwind work with server-rendered HTML?
Yes. The build scans templates for class names regardless of framework, so PHP or server-rendered pages get the same purged, token-driven stylesheet.
Next step
Tell me what you are building, and what is getting in the way.
A short brief is enough to start. You will get clear questions, a practical scope and an honest answer about fit.