Heading (top&bottom) spacing through CSS

Just for posterity why it’s a bad idea to use margins instead of paddings, from Licat, for editing view:

“The editor measures and predicts where elements are located on the page so that when you scroll around, parts of the page that’s out of view can be removed to keep the editor performant. Using margins completely breaks the ability for the editor to do that because margins don’t behave predictably due to the margin collapse algorithm”

(Discord)

3 Likes