Skip to content

Commit

Permalink
When using .[size]-unstack classes in flex grid, only style immediate…
Browse files Browse the repository at this point in the history
… child columns, so the CSS doesn't leak into nested grids. Fixes #8341
  • Loading branch information
gakimball committed Mar 14, 2016
1 parent 2b998a4 commit a93858b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scss/grid/_flex-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
// Auto-stacking/unstacking
@at-root (without: media) {
.row.#{$-zf-size}-unstack {
.column {
> .column {
flex: flex-grid-column(100%);

@include breakpoint($-zf-size) {
Expand Down
49 changes: 49 additions & 0 deletions test/visual/flex-grid/unstack-block-grid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Foundation for Sites Testing</title>
<link href="../assets/css/foundation-flex.css" rel="stylesheet" />
<style>
.column .column {
background: #eee;
}
.column .column .column {
background: #ddd;
}
</style>
</head>
<body>
<div class="row">
<div class="column">
<h1>Flex Grid: Unstack and Block Grid</h1>

<p>The top-level row has the class <code>.medium-unstack</code>, which means child columns stack on small, and sit side-by-side on medium screens and up.</p>

<p>The nested row has the class <code>.up-3</code>, which means its columns are 33% width no matter the screen size.</p>

<p>These two features should not interact. The two top-level columns always stack on small, and the three nested columns always stay the exact same percentage width.</p>

<div class="row medium-unstack">
<div class="column">
<strong>Column One</strong>
<div class="row up-3">
<div class="column">Block Grid Column One</div>
<div class="column">Block Grid Column Two</div>
<div class="column">Block Grid Column Three</div>
</div>
</div>
<div class="column"><strong>Column Two</strong></div>
</div>
</div>
</div>

<script src="../assets/js/vendor.js"></script>
<script src="../assets/js/foundation.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>

0 comments on commit a93858b

Please sign in to comment.