Skip to content

add scroll-margin for focused elements#10

Merged
mayank99 merged 5 commits intomainfrom
mayank99-patch-5
Aug 2, 2023
Merged

add scroll-margin for focused elements#10
mayank99 merged 5 commits intomainfrom
mayank99-patch-5

Conversation

@mayank99
Copy link
Owner

@mayank99 mayank99 commented Jul 31, 2023

see https://www.tpgi.com/prevent-focused-elements-from-being-obscured-by-sticky-headers/

(supported in safari 15, article is outdated)

applies scroll-margin on both ends so the focused element is in a more convenient spot. this is nice even in the absence of sticky headers/bottombars.

the value is debatable, but it will never be more than 10% of the viewport height, so i feel it's an ok default.

@mayank99 mayank99 merged commit 02e15ed into main Aug 2, 2023
@mayank99 mayank99 deleted the mayank99-patch-5 branch August 2, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant