Dynamic styles using tailwind JIT compiler not working bit src tailwind environment
02:20 12 Apr 2023

I have couple of react components created in bit src sope with tailwind environment.(bit src , tailwind environment ).

Its working fine with following variations.

  1. built in classes i.e. w-0 w-1 w-2 w-4 ...
  2. Pre define values i.e. w-[24px] bg-[#123456] ...

Its Not working with dynamic values provided by variable in run time as following. Throwing error saying CssSyntaxError (1:0) D:\Auzmor\office_component_library\node_modules\@auzmorui\component-library.tailwind.environments.env-with-tailwind\dist\tailwind\ Unknown word

const width = 24

tailwind.config.js

module.exports = {
  mode: 'jit',
  content: ['component-library/components/**/*.{js,jsx,ts,tsx}'],
  theme: {}
}

Tailwind version "tailwindcss": "3.1.6"

reactjs tailwind-css jit tailwind-css-3 bit.dev