Integrate Scale UI Radix with Tailwind CSS makes easier the transition from legacy projects.
The integration of Scale UI Radix with Tailwind CSS map the tokens to Tailwind CSS class names, allowing you to use them in your project without effort.To do this you can add the preset in your current configuration that includes all Scale UI Radix colors so you can use them as Tailwind classes in your project.
To start just add it like in the example below in your tailwind.config.ts
file:
This integration allows you to use the semantic accent
, neutral
, warning
, success
, info
and error
from Scale UI Radix as Tailwind CSS classes.
In the same way you can use the text-accent-a5
or border-accent-a5
, etc. to apply the Scale UI Radix colors to the text or border of an element.
There is a range of accent colors to choose from, you can click on the color to copy the Tailwind CSS class to your clipboard.
As of Tailwind v3, styles produced by the @tailwind
directive are usually appended after any imported CSS, no matter the original import order. In particular, Tailwind’s button reset style may interfere with Radix Themes buttons, rendering certain buttons without a background color.
Workarounds:
@tailwind base
.This part of the documentation is still a work in progress. If you have any questions, please ask in the #scaleui-radix-eng channel in Slack.