Hi,
I’m using Ionic as a PWA app for mobile and desktop browsers.
The display on mobile is gorgeous. However, on desktop, it’s really too “stretched”.
What is the simplest way to limit the width of the app, on all pages? It would give the same aspect that the mobile app, on a desktop, which is not ideal, but better that this over-stretched thing.
I was thinking of using grid feature, but in that case I guess I would need to modify all my pages, one by one.
Is there a more generic soluwaytion to do that?
The issue is Ionic use a grid-like system like Bootstrap to maximize compability and responsiveness. If you set a fix-width theme-wide, you’ll wreck the UI on many devices.
But hopefully, that doesn’t prevent you to use responsive CSS rules for desktop and very wide screens in your app global CSS. For example, to detect desktop screen size, I often use that kind of CSS rules (above 1000-1200 pixels screen width size), using @media CSS conditions.
// this rule will only trigger if screen width is above 1000px, so we assume it's a desktop or above, like HDTV
@media (min-width:1000px) {
.header-language-background{padding-left:20px; padding-right: 20px;}
.tabs-wrapper{padding: 0 20px;}
.row-blocs-home{margin:0;}
}
That was the goal of my advice @hudi. Just take care 700px min width is too short, for tablets. So you might have a look on your overall CSS rules, maybe create 3 like i do in all my webdesigns:
for moblie
for tablets
for desktop like and hd
You can create rules with @media (min-width: 300px and max-width:699px) so on… to fit all the 3 rules.
I just want to share this solution cause it took me some time to figure out…
The problem I had will all the other solution was that my popover was not in place.