CSS box-shadow to Tailwind Class

Paste a CSS box-shadow value, with several layers if you like, and get a Tailwind arbitrary-value class, a match against the built-in shadow presets and a theme entry for your config.

Use the tool

Why this tool exists

Design tools export shadows as raw CSS, such as 0 4px 6px -1px rgba(0,0,0,0.1) plus a second layer. In Tailwind you want a class, but the arbitrary-value syntax needs underscores instead of spaces and careful handling of commas and colours, and it is easy to miss that your shadow is already identical to shadow-md.

This converter writes the arbitrary class for you and checks the value against the default presets of Tailwind v3 and v4, so you can use the shorter built-in name when it matches. If the shadow is custom and reused, it also gives the theme extension for tailwind.config.js and the v4 theme variable. It runs in your browser and nothing is uploaded.

How to use it

  1. Paste a box-shadow value or the whole declaration, including inset or multiple layers.
  2. Enter a name for the custom theme shadow if you want to reuse it.
  3. Read the arbitrary class and see whether it matches a built-in preset.
  4. Copy the class, the tailwind.config.js entry or the v4 theme variable into your project.

Frequently asked questions

What does the preset match mean?

It means your shadow is exactly the same as a default Tailwind shadow such as shadow-md, so you can use that class instead of an arbitrary one. The tool checks both v3 and v4 defaults.

Are multiple shadow layers supported?

Yes. Layers are joined into one arbitrary value with commas, and inset shadows are kept. Spaces inside the value are replaced by underscores, as Tailwind requires.

Do I need to put my shadow in the theme?

Not if you use it once. For a shadow used in many places, the theme entry gives you a named class, which is easier to read and change than a long arbitrary value.