
Token Fluid CSS
Converts design tokens into CSS custom properties and Tailwind configuration files. Generates fluid typography and spacing scales using clamp() functions for viewport-adaptive sizing. Frontend developers and UI engineers use it to produce responsive CSS themes from token JSON without external dependencies.
Overview
Token Fluid CSS is an MCP server that processes design tokens to output CSS custom properties (variables) and Tailwind CSS theme configurations. It computes fluid scales for typography and spacing via CSS clamp() functions, ensuring elements scale smoothly across viewport sizes from mobile to desktop. All processing occurs locally with no reliance on external APIs.
Key Capabilities
- Token to CSS conversion: Parses JSON design tokens (e.g., colors, sizes) and emits --token-name: value; declarations in a CSS file.
- Tailwind theme generation: Produces tailwind.config.js with theme extensions for colors, spacing, font sizes derived from tokens.
- Fluid typography scales: Calculates clamp(min, ideal, max) values for font sizes based on token inputs, enabling text that reflows responsively.
- Fluid spacing scales: Applies similar clamp-based computation to margins, paddings, and gaps for consistent responsive layouts.
Use Cases
-
Design system integration: Feed Figma-exported tokens into the server to generate CSS variables and Tailwind config, then import into a Next.js project for theme consistency.
-
Responsive component library: Use fluid typography output to style headings in a React component set, where font sizes adapt without media queries.
-
Prototype theming: Quickly convert ad-hoc token sets to CSS for Tailwind prototypes, testing spacing scales across device sizes.
-
Migration from static CSS: Replace fixed rem/em values with clamp-based scales from tokens, refactoring a site's global styles for better fluidity.
Who This Is For
Frontend developers working with Tailwind CSS or CSS-in-JS, UI engineers maintaining design systems, and teams transitioning from static to token-driven styles. Ideal for those needing local, dependency-free token processing in build pipelines or editors.