Skip to content
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

Support safe area on mobile devices #433

Open
1 task
fflaten opened this issue Jul 29, 2023 · 0 comments · May be fixed by #436
Open
1 task

Support safe area on mobile devices #433

fflaten opened this issue Jul 29, 2023 · 0 comments · May be fixed by #436
Labels
enhancement Something it would be good to improve

Comments

@fflaten
Copy link
Contributor

fflaten commented Jul 29, 2023

What version of starlight are you using?

0.6.0

What is your idea?

Update default styling to stretch beyond "safe area" on devices so styling is consistent on desktop and ex. mobile devices in landscape view.

Required changes:

  • Include viewport-fit=cover in the viewport meta-tag
  • Increase padding on body or .page + any fixed-positioned items like <header> to avoid conflicts with UI-elements/camera on devices
  • Might need to adjust mobile/desktop breakpoints

CSS environment-variables named safe-area-inset-* exist to dynamically provide the correct padding-values per device.

Why is this feature necessary?

Copied from withastro/docs#2270. Same result in a new Starlight-project

On touch devices like iPhones, iPads etc. the website is padded by the browser to avoid content under UI-elements like the "slide for home screen"-bar, camera notch etc. In this area the gradient background is not visible and the website might also get double padding in some elements close to the edges.

image

Do you have examples of this feature in other projects?

Participation

  • I am willing to submit a pull request for this issue.
@HiDeoo HiDeoo linked a pull request Jul 31, 2023 that will close this issue
@delucis delucis added the enhancement Something it would be good to improve label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something it would be good to improve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@delucis @fflaten and others