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

fix: use fallback gutter for fallback breakpoint in XY cell #11194 #11300

Merged
merged 1 commit into from May 28, 2018

Conversation

ncoden
Copy link
Contributor

@ncoden ncoden commented May 25, 2018

Description

When no breakpoint is passed to xy-cell and a fallback "zero" breakpoint is used, use a fallback gutter as well if it is not found. This way, an implicit behavior stay implicit and a warning is thrown only if a breakpoint was explicitely given.

The following code:

$breakpoints: (
  xsmall: 0,
  small: 330px,
  medium: 640px,
  large: 1024px,
  xlarge: 1200px,
  xxlarge: 1440px
);

// (...)

.my-cell {
  @include xy-cell(12);
}

Now generate (instead of throwing a warning):

.test {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

Closes #11194

Motivation and Context

Breakpoint could be added to $breakpoints while $grid-margin-gutters is left unchanged. A custom zero breakpoint like xsmall can be added before small. In this case, @include xy-cell(12); will fail because xy-cell will search for a gutter value for xsmall.

As xy-cell fallback to xsmall implicitly, I expect all values direved from it to also have a fallback, unless we require a zero-breakpoint value to be declared in all breakpoint-related values.

Screenshots (if appropriate):

Types of changes

  • Documentation
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to change)

Checklist (all required):

  • I have read and follow the CONTRIBUTING document.
  • There are no other pull request similar to this one.
  • The pull request title is descriptive.
  • The template is fully and correctly filled.
  • The pull request targets the right branch (develop or support/*).
  • My commits are correctly titled and contain all relevant information.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly to my changes (if relevant).
  • I have added tests to cover my changes (if relevant).
  • All new and existing tests passed.

…n#11194

When no breakpoint is passed to `xy-cell` and a fallback "zero" breakpoint is used, use a fallback gutter as well if it is not found. This way, an implicit behavior stay implicit and a warning is thrown only if a breakpoint was explicitely given.

Closes foundation#11194
@DanielRuf
Copy link
Contributor

So 0 is always the fallback?

@ncoden
Copy link
Contributor Author

ncoden commented May 27, 2018

@DanielRuf Yes. If no gutter is declared for the zero breakpoint, then we generate a cell with... no gutters.

@ncoden ncoden merged commit d4de5d8 into foundation:develop May 28, 2018
@ncoden ncoden added this to the 6.5.0 milestone May 28, 2018
ncoden added a commit to ncoden/foundation-sites that referenced this pull request Jun 16, 2018
…back-11194 for v6.5.0

2e02117 fix: use fallback gutter for fallback breakpoint in XY cell foundation#11194

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Breakpoint breaks XY Grid
2 participants