Skip to content

Commit

Permalink
fixes some issues with vf-grid when in IE11 land (#1328)
Browse files Browse the repository at this point in the history
* fixes some issues with vf-grid when in IE11 land

* fixes changelog typo
  • Loading branch information
Stuart Robson authored Jan 14, 2021
1 parent 59dc0db commit a656c25
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
5 changes: 5 additions & 0 deletions components/vf-grid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.4.0

* fixes flexbox fallback grid when there are items on two or more rows
* fixes widths on flexbox fallback grid.

### 1.3.0

* makes the layout something that can now use 'extends' within nunjucks
Expand Down
49 changes: 43 additions & 6 deletions components/vf-grid/vf-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
.vf-grid > * {
flex: 1;
margin: 10px 0 10px 1.6339%;
margin: 0 0 1rem 1.2292328%;
}

.vf-grid > *:first-child {
Expand All @@ -30,20 +30,56 @@
// Unfortunately IE11 (which this flexbox grid is for) does not support calc inside of flex
// So we've hard coded the percentage values. All other modern browsers get to use grid.
.vf-grid__col-2 > * {
flex: 0 0 49.18305%;
flex: 0 0 49.3853836%;
max-width: 49.3853836%;

&:nth-of-type(3n) {
margin-left: 0;
}
}

.vf-grid__col-3 > *{
flex: 0 0 32.244066667%;
flex: 0 0 32.513844467%;
max-width: 32.513844467%;

&:nth-of-type(4n) {
margin-left: 0;
}
}

.vf-grid__col-4 > * {
flex: 0 0 23.774575%;
// 0.9219246
flex: 0 0 24.0780754%;
max-width: 24.0780754%;


&:nth-of-type(5n) {
margin-left: 0;
}
}

.vf-grid__col-5 > * {
flex: 0 0 18.69288%;
// 0.98338624
flex: 0 0 19.01661376%;
max-width: 19.01661376%;


&:nth-of-type(6n) {
margin-left: 0;
}
}

.vf-grid__col-6 > * {
flex: 0 0 15.305083333%;
// 1.024360667
flex: 0 0 15.642306333%;
max-width: 15.642306333%;


&:nth-of-type(7n) {
margin-left: 0;
}
}

@media (max-width: 1023px) {
.vf-grid {
flex-wrap: wrap;
Expand Down Expand Up @@ -84,6 +120,7 @@

.vf-grid > * {
margin: 0;
max-width: unset;
}

[class*='grid__'] {
Expand Down

0 comments on commit a656c25

Please sign in to comment.