feat: Scroll snap
Enable scroll snap on home page with an option (default false) Signed-off-by: Rémy Jacquin <remy@remyj.fr>
This commit is contained in:
parent
aa91957832
commit
924324d4c1
3 changed files with 27 additions and 9 deletions
|
@ -1,20 +1,36 @@
|
|||
/*
|
||||
/*
|
||||
Removed smooth scrolling implementation in main.js in favor of
|
||||
simpler css approach.
|
||||
See: https://css-tricks.com/snippets/jquery/smooth-scrolling/
|
||||
See: https://css-tricks.com/snippets/jquery/smooth-scrolling/
|
||||
*/
|
||||
*,
|
||||
html {
|
||||
html,
|
||||
:not(.dropdown) {
|
||||
scroll-behavior: smooth !important;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
position: relative;
|
||||
overflow-y: scroll;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
body.scroll-container {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
|
||||
/*
|
||||
Enable scroll snap for home page
|
||||
*/
|
||||
div#home,
|
||||
div.section-holder {
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
/*
|
||||
Fixes anchor overlapping with header.
|
||||
See: https://stackoverflow.com/questions/4086107/fixed-page-header-overlaps-in-page-anchors
|
||||
See: https://stackoverflow.com/questions/4086107/fixed-page-header-overlaps-in-page-anchors
|
||||
*/
|
||||
:target::before {
|
||||
content: '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue