Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 997 Bytes

Readme.md

File metadata and controls

44 lines (30 loc) · 997 Bytes

uncollapse

CSS utility for undoing css margin collapsing

Installation

$ component install jasonkuhrt/uncollapse

API

.uncollapse

Apply this class on a container having its bounds protruded by its descendents' margin-top/bottom's

Example

<!-- Problem -->
<article>
  <div style="background-color:grey;">
    <h1>Demo</h1>
  </div>
  <div style="background-color:red;">
    <p style="margin:32px;">Oops, notice I don't make my container 64px tall</p>
  </div>
</article>



<!-- Solution -->
<article>
  <div style="background-color:grey;">
    <h1>Demo</h1>
  </div>
  <div class="uncollapse" style="background-color:red;">
    <p style="margin:32px;">Good, I am now 64px tall</p>
  </div>
</article>

License

MIT