tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Issue on passing arbitrary values

Open JeevaRamu0104 opened this issue 2 years ago • 3 comments

What version of Tailwind CSS are you using?

3.0.0

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

rescript : 10.1.2 webpack: 5.3.2

What version of Node.js are you using?

For example: v12.0.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Describe your issue

let getUIConfigs = (
  ~sidebar="[#dc2626]",
  (),
) => {
  sidebar: {
    backgroundColor: {
      primaryNormal: `bg-${sidebar}`,
    },
  },
}

In the above config if I pass sidebar as bg-[#dc2626] it is working as expected but if I pass only color code [#dc2626] its not working and tailwind is also not generating the color code #dc2626

JeevaRamu0104 avatar Apr 10 '24 18:04 JeevaRamu0104

Not a bug. There is paragraph in docs about this https://tailwindcss.com/docs/content-configuration#dynamic-class-names

rrostyslav avatar Apr 11 '24 21:04 rrostyslav

@JeevaRamu0104 Is it possible in the future, tailwind handle custom arbitrary classes? Maybe, just for them, consider adding css-in-js layer, that you can turn on/off in tailwind.config?

rrostyslav avatar Apr 11 '24 21:04 rrostyslav

I mean, I would like tailwind to handle described issue above

rrostyslav avatar Apr 11 '24 21:04 rrostyslav