Remove vertical-align: middle from block elements in default styles #18259
imadghoummaid
started this conversation in
Ideas
Replies: 1 comment
-
This seems like a feature request of sorts so migrated to a discussion. So the tailwindcss/packages/tailwindcss/preflight.css Lines 203 to 219 in f0f42f6 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
For example: v4.1.7
What build tool (or framework if it abstracts the build tool) are you using?
Tailwindcss-cli ^4.1.7
What version of Node.js are you using?
v20.0.0
What browser are you using?
Chrome
What operating system are you using?
Windows
Reproduction URL
https://play.tailwindcss.com/
And when i install tailwindcss and @tailwindcss/cli via npm.
Describe your issue
Currently, Tailwind CSS applies the following default style to several elements:
However, the vertical-align property is ignored when display: block is set. This results in an unnecessary rule that triggers warnings in code editors such as Visual Studio Code:
While vertical-align: middle can be useful for elements with display: inline-block, it serves no purpose in this context. Removing it would improve CSS correctness and eliminate unnecessary warnings.
A better approach could be:
Or, if necessary, apply vertical-align: middle only when display: inline-block is explicitly used.
Would love to hear thoughts on whether this can be refined in a future release!
Beta Was this translation helpful? Give feedback.
All reactions