Skip to content

Commit

Permalink
fix: use newer scroll polyfill to allow offset
Browse files Browse the repository at this point in the history
close #17
  • Loading branch information
jonaskuske committed Mar 11, 2022
1 parent 8fc1873 commit f07bd70
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ input[type='search']::-webkit-search-results-decoration {
scroll-behavior: smooth;
}

.scroll-pt-20 {
scroll-padding-top: 5rem;
.scroll-mt-20 {
scroll-snap-margin-top: 5rem;
scroll-margin-top: 5rem;
}

.bg-angled-yellow {
Expand Down
4 changes: 3 additions & 1 deletion src/assets/js/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict'
;(function loadPolyfills(doc, base) {
if (!('scrollBehavior' in doc.documentElement.style)) {
insertScript(base + 'smoothscroll-polyfill.min.js')
insertScript(base + 'seamless-scroll-polyfill.min.js', function () {
window.seamless.polyfill()
})
insertScript(base + 'smoothscroll-anchor-polyfill.min.js')
}

Expand Down
17 changes: 17 additions & 0 deletions src/assets/js/vendor/seamless-scroll-polyfill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/assets/js/vendor/smoothscroll-anchor-polyfill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/assets/js/vendor/smoothscroll-polyfill.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/site/config/asset-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'/assets/js/vendor/alpine.min.js',
'/assets/js/vendor/focus-visible.min.js',
'/assets/js/vendor/object-fit-images.min.js',
'/assets/js/vendor/smoothscroll-polyfill.min.js',
'/assets/js/vendor/seamless-scroll-polyfill.min.js',
'/assets/js/vendor/smoothscroll-anchor-polyfill.min.js',
'/assets/fonts/Chivo_Light-Italic.woff2',
'/assets/fonts/Chivo_Regular.woff2',
Expand Down
2 changes: 1 addition & 1 deletion src/site/snippets/head.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html
lang="de"
class="h-full font-sans antialiased leading-normal scroll-smooth scroll-pt-20 scrollbar-lightgray"
class="h-full font-sans antialiased leading-normal scroll-smooth scrollbar-lightgray"
>

<?php
Expand Down
Loading

0 comments on commit f07bd70

Please sign in to comment.