(core) Add viewport meta tag conditionally, and show a toggle for it on small devices.

Summary:
- Enable narrow-screen layout for home page
- Clean up margins/spacing on small-screen home page
- Use "<768" as small-screen condition rather than "<=768".
- Include meta-viewport tag conditionally, off by default.
- Include "Toggle Mobile Mode" option in AccountMenu to toggle it on.
- In a test, add an after() clause to restore window size even when test fails

Test Plan: Only tested manually on iPhone (Safari & FF).

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: cyprien

Differential Revision: https://phab.getgrist.com/D2708
This commit is contained in:
Dmitry S
2021-01-21 14:12:24 -05:00
parent f4366a01b3
commit 586b6568af
9 changed files with 162 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
import {transientInput} from 'app/client/ui/transientInput';
import {colors, vars} from 'app/client/ui2018/cssVars';
import {colors, mediaSmall, vars} from 'app/client/ui2018/cssVars';
import {icon} from 'app/client/ui2018/icons';
import {styled} from 'grainjs';
@@ -15,6 +15,11 @@ export const docList = styled('div', `
display: block;
height: 64px;
}
@media ${mediaSmall} {
& {
padding: 32px 24px 24px 24px;
}
}
`);
export const docListHeader = styled('div', `
@@ -216,6 +221,12 @@ export const prefSelectors = styled('div', `
right: 64px;
display: flex;
align-items: center;
@media ${mediaSmall} {
& {
right: 24px;
}
}
`);
export const sortSelector = styled('div', `
@@ -236,4 +247,9 @@ export const sortSelector = styled('div', `
box-shadow: none;
background-color: ${colors.mediumGrey};
}
@media ${mediaSmall} {
& {
margin-right: 0;
}
}
`);