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

Scroll-snap CSS override is unnecessary and incompatible with older browsers #755

Closed
chalin opened this issue Sep 22, 2021 · 0 comments · Fixed by #2840
Closed

Scroll-snap CSS override is unnecessary and incompatible with older browsers #755

chalin opened this issue Sep 22, 2021 · 0 comments · Fixed by #2840
Labels
design/style Front-end site design / styling e0-minutes Effort: < 60 min e1-hours Effort: < 8 hrs ux

Comments

@chalin
Copy link
Contributor

chalin commented Sep 22, 2021

Consider the following CSS override (relative to the Docsy base CSS):

// Adjust anchors scroll snap (https://github.com/open-telemetry/opentelemetry.io/pull/348)
@include media-breakpoint-up(md) {
h2[id], h3[id], h4[id], h5[id] { scroll-margin-top: 5rem; }
h2[id]:before, h3[id]:before, h4[id]:before, h5[id]:before {
margin-top: 0;
height: 0;
}
}

The original problem (#348) wasn't due to Docy's scroll-snap CSS, it was because of the use of flex displays in non-documentation pages. While scroll-margin-top works wonderfully well, but it's support isn't that great -- see SO and scroll-margin-top. For example, it's been supported in iOS Safari only recently.

I see top options: fix the non-doc pages and fall back to Docy's CSS, or (assess &) consider the alternative solution proposed in SO.

@chalin chalin added e0-minutes Effort: < 60 min e1-hours Effort: < 8 hrs style ux labels Sep 22, 2021
@chalin chalin added design/style Front-end site design / styling and removed style labels Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/style Front-end site design / styling e0-minutes Effort: < 60 min e1-hours Effort: < 8 hrs ux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant