Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme() function is not available when adding arbitrary properties #6619

Closed
ARZarkesh opened this issue Dec 19, 2021 · 2 comments · Fixed by #6854
Closed

theme() function is not available when adding arbitrary properties #6619

ARZarkesh opened this issue Dec 19, 2021 · 2 comments · Fixed by #6854

Comments

@ARZarkesh
Copy link

ARZarkesh commented Dec 19, 2021

What version of Tailwind CSS are you using?

3.0.7

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

webpack 5.65.0, postcss 8.4.5

What version of Node.js are you using?

v16.13.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

(https://play.tailwindcss.com/RjtpBVfT0a)

Describe your issue

theme() function not works in arbitrary properties. But works in normal css.

@adamwathan
Copy link
Member

Ah good catch! I think this is an issue with how we match possible classes in templates.

Will look into it, in the mean time though you can workaround this by getting rid of the quotes:

<p class="[--y:theme(colors.blue.500)]">...</p>

https://play.tailwindcss.com/K7uUfygTjO

They are optional but we document it with them because it tends to syntax highlight better in people's editors 👍🏻

@RobinMalfait
Copy link
Contributor

Hey! Thank you for your bug report!
Much appreciated! 🙏

This should be fixed, and will be available in the next release (probably later today).

You can already try it by using the insiders build npm install tailwindcss@insiders or yarn add tailwindcss@insiders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants