houndci / hound

Automated code review for GitHub pull requests.
https://houndci.com
MIT License
1.95k stars 402 forks source link

Fix missing margin #1814

Closed tysongach closed 4 years ago

tysongach commented 4 years ago

By default, all p elements have some bottom margin, but on the home page, we were overriding that with margin: 0; - that was done using an overly-specific selector and by using the margin shorthand:

https://github.com/houndci/hound/blob/5cdb8ec492d77aa2cf4f566e3f6b17f2f389ab54/app/assets/stylesheets/pages/home/_home-objects.scss#L15-L17

This meant our margin-top-large utility class was not working.

Part of this problem is what is called an ‘accidental reset’: https://css-tricks.com/accidental-css-resets/

By only setting the margin-bottom, we are only resetting the exact piece we want to reset, not all margins.

Before

Screen Shot 2020-08-10 at 15 36 25

After

Screen Shot 2020-08-10 at 15 36 49