Skip to content

Tailwind Typography for bigger font-size adds huge margins on h2 & other elements #3006

Answered by simonswiss
deadcoder0904 asked this question in Help
Discussion options

You must be logged in to vote

Hey @deadcoder0904 👋

Thanks for reaching out.

So, what happens in your situation is the collapsing margins stop collapsing because you are using CSS grid.

The huge space between your h1 and h2, as well as between your ul and ol, is happening as the margin-bottom of one element is now additional to the margin-top of the next element.

Why doesn't this happen on h2, h3 h4, I hear you ask?

Well, there was a deliberate typography decision baked in the code to remove the margin-top entirely for elements immediately following h2, h3 or h4`, as you can see on these lines of code in the Typography plugin.

So - if you want to preserve your Grid, you could add the same treatment for the elements fol…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@deadcoder0904
Comment options

@simonswiss
Comment options

@braydoncoyer
Comment options

@simonswiss
Comment options

@braydoncoyer
Comment options

Answer selected by deadcoder0904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants