tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
82.3k stars 4.17k forks source link

Support `number` type in config file for `zIndex` #10906

Closed xsjcTony closed 1 year ago

xsjcTony commented 1 year ago

What version of Tailwind CSS are you using?

v3.3.0

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

postcss v8.4.21, Vite v4.2.1, TypeScript v5.0.2

What version of Node.js are you using?

v16.18.0

What browser are you using?

Chrome v111

What operating system are you using?

Windows

Reproduction URL

https://stackblitz.com/edit/vitejs-vite-rgunfq?file=tailwind.config.ts

Describe your issue

I think it doesn't make sense to force a zIndex to be a string, from my perspective number should also be acceptable, especially we can use syntax like foo: 1_000_000 where it's much clearer than foo: '1000000'. Is there any reason to force string that I do not know?

reinink commented 1 year ago

Hey! You're right, some values in our config technically could be treated as numbers. For now though we've opted to just keep things simple and make all config values strings, as using strings is quite often necessary since many values include units (ie. px and rem). Hope that makes sense! 🤙