Skip to content

Commit 99f067f

Browse files
authored
fix(grid): fix stackable nested grid
This PR reverts and corrects #1739 for stackable nested grids. The margins on mobile screens for stackable grid has now been adjusted so it only takes place when a stackable grid is not nested in another grid or a segment.
1 parent 250ba1e commit 99f067f

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/definitions/collections/grid.less

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,15 +1009,15 @@
10091009
----------------------- */
10101010

10111011
.ui.padded.grid:not(.vertically):not(.horizontally) {
1012-
margin: 0 !important;
1012+
margin: 0;
10131013
}
10141014
[class*="horizontally padded"].ui.grid {
1015-
margin-left: 0 !important;
1016-
margin-right: 0 !important;
1015+
margin-left: 0;
1016+
margin-right: 0;
10171017
}
10181018
[class*="vertically padded"].ui.grid {
1019-
margin-top: 0 !important;
1020-
margin-bottom: 0 !important;
1019+
margin-top: 0;
1020+
margin-bottom: 0;
10211021
}
10221022
}
10231023

@@ -1678,10 +1678,11 @@
16781678
-------------------- */
16791679

16801680
@media only screen and (max-width: @largestMobileScreen) {
1681-
.ui.ui.ui.ui.stackable.grid {
1681+
body > .ui.stackable.grid,
1682+
.ui:not(.segment):not(.grid) .ui.stackable.grid {
16821683
width: auto;
1683-
margin-left: 0 !important;
1684-
margin-right: 0 !important;
1684+
margin-left: @stackableMobileGutter;
1685+
margin-right: @stackableMobileGutter;
16851686
}
16861687
.ui.stackable.grid > .row > .wide.column,
16871688
.ui.stackable.grid > .wide.column,
@@ -1710,8 +1711,8 @@
17101711
/* Don't pad inside segment or nested grid */
17111712
.ui.grid .ui.stackable.grid,
17121713
.ui.segment:not(.vertical) .ui.stackable.page.grid {
1713-
margin-left: -(@stackableGutter / 2) !important;
1714-
margin-right: -(@stackableGutter / 2) !important;
1714+
margin-left: -(@stackableGutter / 2);
1715+
margin-right: -(@stackableGutter / 2);
17151716
}
17161717

17171718
/* Divided Stackable */

src/definitions/modules/popup.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
*******************************/
695695

696696
/* Immediate Nested Grid */
697-
.ui.popup > .ui.grid:not(.padded) {
697+
.ui.ui.ui.popup > .ui.grid:not(.padded) {
698698
width: @nestedGridWidth;
699699
margin: @nestedGridMargin;
700700
}

src/themes/default/collections/grid.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
@stackableRowSpacing: @rowSpacing;
6969
@stackableGutter: @gutterWidth;
70+
@stackableMobileGutter: 0;
7071
@stackableMobileBorder: 1px solid @borderColor;
7172
@stackableInvertedMobileBorder: 1px solid @whiteBorderColor;
7273

0 commit comments

Comments
 (0)