0

How do I remove the margin from two columns with nested offset columns inside of them. I want to make sure that the content within the column's is always centered and I can not seem to get this to work using the @include row (table); mixin.

The codepen

The html

<section>
  <div class="container">
    <div class="col">
      <div class="inner">
        centered content
      </div>
    </div>
    <div class="col">
      <div class="inner">
        centered content
      </div>
    </div>
  </div>
</section> 

The SCSS

@import "bourbon";
@import "neat";

section{
  @include outer-container(100%);

  .container{
      @include span-columns(12);
      @include fill-parent;

    .col{
      @include span-columns(6);
         border: 2px solid black;

      .inner{
         @include shift-in-context(1 of 6);
         @include span-columns(8 of 12);
          background: red;

      }
    }
  }
}
Simon
  • 147
  • 1
  • 10

2 Answers2

1

You mean this gap?

CSS

.col{
  @include span-columns(6);
     border: 2px solid black;
     margin-right: 0;
     width: 50%;
Cyto
  • 60
  • 1
  • 8
  • I want to remove the gap between the cols (original pen) whilst still keeping 100% container width. – Simon Feb 16 '17 at 12:29
1

There's an option built in to Neat. It's the reset-display() mixin. Reset it from table to block in the .inner class and I think you're in good shape.

section {
  @include outer-container(100%);

  .container {
    @include row(table);
    @include fill-parent;

    .col {
      @include span-columns(6);
      border: 2px solid black;

      .inner {
        @include reset-display;
        @include shift-in-context(1 of 6);
        @include span-columns(8 of 12);
        background: red;
      }
    }
  }
}
alexbea
  • 1,311
  • 14
  • 25