Skip to content

fix(grid): fix stackable nested grid #2269

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

Merged
merged 16 commits into from
Jan 8, 2023

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Mar 16, 2022

Description

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.

Testcase

From #2263
https://jsfiddle.net/lubber/bkrqfnhv/16/

From #1739
https://jsfiddle.net/lubber/fv1hg0jm/23/

From #1907
https://jsfiddle.net/lubber/vqj0xdg1/22/

Closes

#2263
#1907

@lubber-de lubber-de added type/bug Any issue which is a bug or PR which fixes a bug lang/css Anything involving CSS state/awaiting-reviews Pull requests which are waiting for reviews labels Mar 16, 2022
@lubber-de lubber-de added this to the 2.9.0 milestone Mar 16, 2022
@hugopeek
Copy link
Contributor

Hi @lubber-de, thanks for your efforts. I'm not sure if the variable you introduced is a safe solution. Doesn't that apply to all mobile grids now? Same goes for the !important classes. Although I'd love to see them go too, they might disrupt the balance in other scenarios.

I feel this is really an isolated bug inside nested stackable mobile grids. But I will test these changes out of course, to see what happens.

As a sidenote: the double gutter is not a design decision in SUI. See the comments ;)

/* Don't pad inside segment or nested grid */
.ui.grid .ui.stackable.grid,
.ui.segment:not(.vertical) .ui.stackable.page.grid {
margin-left: -(@stackableGutter / 2) !important;
margin-right: -(@stackableGutter / 2) !important;
}

This is the original library with the same HTML:

https://jsfiddle.net/db7xuLgo/1/

@lubber-de
Copy link
Member Author

lubber-de commented Mar 17, 2022

I'm not sure if the variable you introduced is a safe solution. Doesn't that apply to all mobile grids now?

tbh, i wasn't really convinced myself, yes this would affect all mobile grids, if changed (that's why i kept the default value to the original 0)

Same goes for the !important classes. Although I'd love to see them go too, they might disrupt the balance in other scenarios.

From what i tested, those really were not necessary and removing them just fixed the the issue from #1739
I would appreciate if you could test more deeplyusing your projects 😉

I feel this is really an isolated bug inside nested stackable mobile grids.

Yes, the more i think about that, i also feel this way. The gutter should only be used if the stackable grid isnt nested. Tehre

But I will test these changes out of course, to see what happens.

❤️

As a sidenote: the double gutter is not a design decision in SUI. See the comments ;)

Yes, saw them :) But they meant to not pad when nested. The unnested .ui.stackable.grid 0 gutter seems to be meant for stackable grids which are not nested and a direct child of body (or at least not inside another grid/container/segment) ,i believe. (That's why i guessed the the "fingers covering smartphone sides")

This is the original library with the same HTML:

jsfiddle.net/db7xuLgo/1

That seems to work exactly like my fix in this PR 🙂
https://jsfiddle.net/lubber/bkrqfnhv/2/

@lubber-de lubber-de marked this pull request as draft April 2, 2022 08:21
@lubber-de lubber-de removed the state/awaiting-reviews Pull requests which are waiting for reviews label Apr 2, 2022
@lubber-de lubber-de modified the milestones: 2.9.0, 2.9.x Sep 15, 2022
@lubber-de lubber-de marked this pull request as ready for review December 27, 2022 21:05
@auto-assign auto-assign bot removed the request for review from exoego December 27, 2022 21:05
@lubber-de lubber-de modified the milestones: 2.9.x, 2.9.1 Dec 27, 2022
@lubber-de
Copy link
Member Author

The extra mobile gutter is now only used when not nested inside another grid or segment. This fixes all 3 issues now

@lubber-de lubber-de merged commit 99f067f into fomantic:develop Jan 8, 2023
@lubber-de lubber-de deleted the fix/2263/stackableNestedGrid branch January 8, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants