Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Arbitrary value class not compiled when passed to Gatsby component through a prop #186

Closed
rbottomley opened this issue Mar 29, 2021 · 3 comments

Comments

@rbottomley
Copy link

What version of @tailwindcss/jit are you using?

v0.1.17

What version of Node.js are you using?

v15.12.0

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

gatsby-cli v3.1.0

What browser are you using?

Firefox, Chrome

What operating system are you using?

Fedora Linux 33

Reproduction repository

https://github.com/rbottomley/jit-issue

An arbitrary value class does not get compiled by Tailwind JIT when the class contains values that are passed into a Gatsby component via props.

Example, index.js contains:
<Widget w="420px"/>

and widget.js component contains:

import React from 'react'

export const Widget = (props) => (
  <div className={`bg-[#0b0] w-[${props.w}] my-6 p-6`}>
      Tailwind JIT example inside of component. {props.w} wide
  </div>
)

The HTML output is correct:
<div class="bg-[#0b0] w-[420px] my-6 p-6">Tailwind JIT example inside of component. 420px wide</div>

The arbitrary value class bg-[#0b0] works but w-[420px] does not.

@alanonthegit
Copy link

Having this issue as well @adamwathan

@ICE-Cold-Ethanol
Copy link

I think this has been answered before,
see #138 (comment)

@rbottomley
Copy link
Author

Oh, it sure has. Thanks for the info. Closing this.

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

No branches or pull requests

3 participants