foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Using collapse doesn't seem to set the correct width on first and last cells

Open codedbypaul opened this issue 8 years ago • 6 comments

How can we reproduce this bug?

<row class="collapse">
   <columns small="12" large="4">
      <img src="assets/img/image1.jpg" />
      <h3>One Word</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br>
      <a href="#">Read more</a></p>
   </columns>
   <columns small="12" large="4">
      <img src="assets/img/image2.jpg" />
      <h3>One Word</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br>
      <a href="#">Read more</a></p>
   </columns>
   <columns small="12" large="4">
      <img src="assets/img/image3.jpg" />
      <h3>One Word</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br>
      <a href="#">Read more</a></p>
   </columns>
</row>

What did you expect to happen?

expected

What happened instead?

actual

What email clients does this happen in?

Only testing locally at the moment.

codedbypaul avatar Jun 02 '16 16:06 codedbypaul

I have my global width set to 600px. I was expecting 3 columns to be 200px each. For some reason .first and .last are given a width of 208px.

codedbypaul avatar Jun 02 '16 16:06 codedbypaul

Does this happen with the default global width?

rafibomb avatar Jun 03 '16 22:06 rafibomb

@codedbypaul We're looking to narrow down how/when it's happening. Do you see this with different container widths including the default width? Can you see if changing that affect it's greater or less?

rafibomb avatar Jun 22 '16 16:06 rafibomb

We're seeing it on the default container width, but only at the large breakpoint. When it switches to small, the column widths all match.

keokilee avatar Jun 25 '16 01:06 keokilee

Does anyone have a work-around for this?

axelson avatar Jul 18 '16 20:07 axelson

File _grid.scss:

  //Collapsed logic
  .collapse {
    > tbody > tr > td.large-#{$i},
    > tbody > tr > th.large-#{$i} {
      padding-right: 0;
      padding-left: 0;
      width: -zf-grid-calc-px($i, $grid-column-count, $global-width) + $global-gutter;
    }

    //Gotta give it that extra love for the first and last columns.
    td.large-#{$i}.first,
    th.large-#{$i}.first,
    td.large-#{$i}.last,
    th.large-#{$i}.last {
      width: -zf-grid-calc-px($i, $grid-column-count, $global-width) + ($global-gutter * 1.5);
    }
  }

For what purpose was added this 1.5 multiplier for .first/.last columns? - ($global-gutter * 1.5)

evanre avatar Dec 13 '18 13:12 evanre