Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto and shrink cells are broken #10891

Closed
skotlinski1 opened this issue Jan 29, 2018 · 6 comments
Closed

auto and shrink cells are broken #10891

skotlinski1 opened this issue Jan 29, 2018 · 6 comments

Comments

@skotlinski1
Copy link

How to reproduce this bug:

Here is a link:
https://codepen.io/skotlinski1/pen/LQYOpN

What should happen:

On large every cells should be 100% width (large-12) except 4th scenario where second cell on medium should be '3 units' long

What happened instead:

Big mess instead, click on the link and see :-)

Browser(s) and Device(s) tested on:

Safari 11.01, Chrome 63, Firefox 57, Opera 50

Foundation Version(s) you are using:

6.4.3 and 6.4.4-rc1

Test case link:

https://codepen.io/skotlinski1/pen/LQYOpN

@skotlinski1
Copy link
Author

Workaround:

I've added to the file _classes.scss in line 86 "xy-cell-base();" and now it works fine :-)

 @for $i from 1 through $grid-columns {
   // Sizing (percentage)
   .grid-x > .#{$-zf-size}-#{$i} {
     @include xy-cell-base(); // <-- ADDED BY ME
     @include xy-cell-static($i, false, $gutter-type: padding);
   }
 }

@ncoden ncoden self-assigned this Jan 30, 2018
@skotlinski1
Copy link
Author

Second workaround:

Because the first one increased app.css size by 5-8kb, I've added another mixin instead:

// Reset width of cell on particular breakpoint (and up)
  
@mixin dss-reset-cell-width-to-full {
  @include -zf-each-breakpoint() {
    @if not($-zf-size == small) {
      .grid-x > .#{$-zf-size}-width-reset {
        @include xy-cell-base(full);
      }
    }
  }
}
@include dss-reset-cell-width-to-full();

It creates additional classes for each breakpoint e.g. medium-width-reset, large-width-reset etc.

Put it together with another "static-sized" cell class, e.g. "large-12 large-width-reset" or "medium-3 medium-width-reset"

examples:
<div class=cell medium-auto large-12 large-width-reset>
or
<div class=cell shrink medium-6 medium-width-reset large-auto>

@ncoden
Copy link
Contributor

ncoden commented Feb 10, 2018

Hi @skotlinski1. I finally had enough time to investigate your issue. At first, thank you for the CodePen you provided. It help us a lot to test everything and understand what's wrong. 👍

All the bugs you found comes from two little mistakes: we forgot to reset flex-shrink, flex-grow and flex-basis it some responsive modifiers of the XY grids. So "it works" when you re-apply "xy-cell-base" everywhere, but it would come with a lot of stuff we do not want to duplicate ;)

I'll open a PR. Thanks again for the ✨ quality ✨ of this issue ;)

@ncoden
Copy link
Contributor

ncoden commented Feb 10, 2018

@skotlinski1 See #10927.

Does it solves your issue ?

@rafibomb
Copy link
Member

@skotlinski1 This seems to be the fix. How did it work for you? Just trying to make sure we can merge this in.

@skotlinski1
Copy link
Author

Yes, thank you, now everything works great :-)

@ncoden ncoden closed this as completed Feb 13, 2018
ncoden added a commit that referenced this issue Mar 3, 2018
…s-reset-10891

fix: fix XY Grid responsive widths with shrink/auto #10891
ncoden added a commit to ncoden/foundation-sites that referenced this issue Jun 16, 2018
…modifiers-reset-10891 for v6.5.0

8347330 fix: add missing flex reset in XY Grid responsive cell widths foundation#10891
16e18da tests: add visual test for XY Grid reponsive widths foundation#10891

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
ncoden added a commit to ncoden/foundation-sites that referenced this issue Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants