static-cms/website/gatsby-browser.js
2018-07-25 07:47:26 -04:00

11 lines
252 B
JavaScript

import SmoothScroll from 'smooth-scroll';
// Make scroll behavior of internal links smooth
exports.onClientEntry = () => {
new SmoothScroll('a[href*="#"]', {
offset() {
return document.querySelector('#header').offsetHeight;
}
});
};