Skip to content

Tailwind compiler crashes when you try to [--box-shadow:theme('boxShadow.doesNotExist')] #9318

@Odas0R

Description

@Odas0R

What version of Tailwind CSS are you using?

v3.1.8

What build tool (or framework if it abstracts the build tool) are you using?

vite 3.0.9, postcss 8.4.14 postcss-cli 8.3.1

What version of Node.js are you using?

v16.0.0

What browser are you using?

Chrome

What operating system are you using?

PopOS, Ubuntu

Reproduction URL

https://stackblitz.com/edit/vitejs-vite-zy2efk?file=src/App.jsx

Describe your issue

I was thinkering with tailwind to find ways of modifying css variables with classes. Came up with something like

  <button className="[--box-shadow:theme('boxShadow.sm')] bg-white p-5">
    Button
  </button>

But if I change the theme to something that will throw a runtime error:

  <button className="[--box-shadow:theme('boxShadow.doesNotExist')] bg-white p-5">
    Button
  </button>

Still crashes if I change it back to:

  <button className="[--box-shadow:theme('boxShadow.sm')] bg-white p-5">
    Button
  </button>

Well, maybe the Tailwind compiler crashes and can't recover?

It's a bug, I think!?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions