I'm very new to Tailwind, and I have weird problem. When I apply tailwind classes to react component, some of them (eg. bg-default-800, rounded-lg) work normal, but some don't.
export function Tile(props: PropsWithChildren<propsInterface>) {
return (
<div
className={'bg-default-800 m-2 rounded-lg flex flex-col justify-center ' +
'w-' + props.width + '/4 h-' + props.height + ' '}>
{props.children}
</div>
)
}
Here's usage of this component:
function App() {
return (
<div className={'flex flex-row flex-wrap'}>
<Tile width={1} height={36}>
tile 1
</Tile>
<Tile width={3} height={36}>
tile 2
</Tile>
</div>
)
}
Here's tailwind.config.cjs:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {
colors: {
'default': {
'800': '#166534',
},
},
},
},
plugins: [],
}
In this case, 'w-1/4' works, but 'w-3/4' don't. It worked only after I had changed className to hardcoded values (without props). Then, I redo changes and it still works, which is weird. When it comes to height, 'h-32' works, but 'h-36' doesn't, like many other values from tailwind documentation. Shift + F5 doesn't help.