fomantic / Fomantic-UI

Fomantic-UI is the official community fork of Semantic-UI
https://fomantic-ui.com
MIT License
3.58k stars 333 forks source link

[Grid] add support for `only=small screen` #1599

Open layershifter opened 4 years ago

layershifter commented 4 years ago

Semantic/Fomantic UI has breakpoints for small screens (https://fomantic-ui.com/elements/container.html) and there is support for device visibility breakpoints (https://fomantic-ui.com/collections/grid.html#device-visibility). But at the same point there is no small screen only :(

It will be great to have a separate option to restrict visibility for small screens.

Original request: https://github.com/Semantic-Org/Semantic-UI-React/issues/3991

lubber-de commented 4 years ago

There already exists mobile only . Doesn't this fullfill the requirement ? image

The docs example also covered that

image

layershifter commented 4 years ago

No, it's a different. Currently possible values:

But there is no small screen only which will cover more than tablet, less than large screen

ko2in commented 4 years ago

@layershifter How can it be small screen if it's more than tablet? Can you clarify better or you can suggest your expected resolution size?

layershifter commented 4 years ago

How can it be small screen if it's more than tablet?

Will it be more clear if I will call it small computer screen? 🐱

https://github.com/fomantic/Fomantic-UI/blob/ae0b66459671c6e8f009290f012d5b1db65bdab9/src/definitions/collections/grid.less#L1801

https://github.com/fomantic/Fomantic-UI/blob/0b7630b906b3ad8b8a6d47ac91e424242923e338/src/themes/default/globals/site.variables#L222-L223

^ it can be. I expect that there will be a modifier that allows to have visibility between these variables.

DeeeeLAN commented 4 years ago

Correct, If I have a monitor that is 1024 wide (such as an iPad in landscape mode), there is no grid size class for that specifically. There is a specific size class for every other pixel count, but it skips over the 992-1200 range.

lubber-de commented 4 years ago

If we implement this, then we are going to implement a whole additional breakpoint which has to be covered in all other components as well (container, dropdown, modal, search, card, item, divider, probably more)

Tbh: we would implement a breakpoint which differs only in 32px from @computerbreakpoint..is it really worth it?

If you compare to bootstrap they also don't differ in between 992px and 1200px . https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints

🤔

ko2in commented 4 years ago

IMHO, from above 1024px, there's no limit to control the break points, and it relies more on your own specific requirements and thus you should have your own custom break points for that.

The standard break points specification in framework should be only for the cross devices and platforms with different resolutions.

DeeeeLAN commented 4 years ago

We already have a computer breakpoint at 992px, we just need a class that is only computer, not computer and large monitor or widescreen. Bootstrap has the "large device" class, but we go straight from "medium device" to "extra large device" in our grid, or you go from medium to "large and extra large" using the computer breakpoint.

Here is my use-case. I have a grid of tables that I rearrange to be responsive based on the screen width, so I might be 3x2 on the large monitor and widescreen, but 2x3 on the small monitor and tablet screens. This is not currently possible using the provided grid size classes, so I have had to do it manually.

lubber-de commented 4 years ago

Ok, i think, i understood now 😄

However, while we are at it, why don't we move this logic out of the the grid and make it globally available, so it can be used by any component? I personally use this ever since https://github.com/Semantic-Org/Semantic-UI/issues/1114#issuecomment-201057438

and already commented in the helper class thread at https://github.com/fomantic/Fomantic-UI/issues/22#issuecomment-429109342

That addional "small screen" could then be added globally @fomantic/admins ?