Tailwind CSS how to code pixel perfect design

Ok got it, I need to edit tailwind.config.js and set custom sizes there. For example:

height: [
  ...
  '278px': '278px',
  ...
]

So now this size can be set with <div clas="h-278px">...</div>

Update:

After completed many projects on top of TailwindCSS I learned that it’s not very optimal to set spacing/w/h… in tailwind config if it’s used only once. It’s better to go with the custom class you can always use @apply in that class anyway.

Update 2021:

As of tailwind version 2.1 we can enable JIT and use arbitrary styles like this:

mb-[278px]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)