question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Grid] `.stackable` and regular grids have inconsistent margins on mobile screens

See original GitHub issue

Grid and stackable grids don’t seems to have the same behavior on small screens:

@media only screen and (max-width: 767px) {
    .ui.grid {
        margin-left: -1rem !important;
        margin-right: -1rem !important;
    }
    .ui.stackable.grid {
        margin-left: 0rem !important;
        margin-right: 0rem !important;
    }
}

To mix .ui.grid and .ui.stackable.grid on the same page I have to fix this in grid.overrides:

@media only screen and (max-width: 767px) {
    .ui.grid {
        margin-left: 0rem !important;
        margin-right: 0rem !important;
    }
}

Have I missed something?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
hugopeekcommented, Apr 14, 2017

You’re not missing anything, I keep bumping into this one too. I ended up with the following fix, similar to yours:

.ui.grid.container > .column,
.ui.container .grid:not(.nested) > .column {
    @media only screen and (max-width: @largestMobileScreen) {
        padding-left: 0 !important;
        padding-right: 0 !important;

        // Nested stackable grids are negatively affected by this change
        .ui.stackable.grid {
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
    }
}

It’s far from ideal, because it requires a custom .nested class to be assigned to all nested grids. I’m running into problems now because that class is not present in some scenarios, so I’m looking for a better fix.

Also, adding .relaxed classes to the affected grids will probably mess with this fix.

This issue seems to be related too: #4129

0reactions
dbendaoucommented, Nov 28, 2018

Hi, I have the same issue here, negative margin on mobile cause my layout to be scrollable even if there is nothing to scroll … 🐛

EDIT : it’s seems that if you add an <div class="ui container"> around the negative margin grid solve the issue. The scroll isn’t there anymore, but the negative margin does

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS grid not displaying correctly on actual mobile browsers ...
You use grid-gap . grid-gap has been deprecated in favor of gap . The gap CSS property sets the gaps (gutters) between rows...
Read more >
Everything you need to know about spacing & layout grids
Margins are the negative space between the edge of the outside column and the frame. There are many ways to combine columns, gutters,...
Read more >
Why Bootstrap's grid gutters in the middle are twice as large ...
The reason for the inconsistency is that the grid columns extend to the edge of the container, and the containers margin (or padding)...
Read more >
CSS Grid Gotchas And Stumbling Blocks - Smashing Magazine
The first layout uses flexbox to display as many boxes as will fit into the available width. Here we are controlling the layout...
Read more >
Stackable – Page Builder Gutenberg Blocks – WordPress plugin
Feature Grid Display multiple product features or services. You can use Feature Grids one after another. Notification Show a notice to your readers....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found