Smooth Scroll Offset Anchor Links with CSS (SCSS Mixin)

/// Smooth Scroll Offset Anchor Links with CSS /// @link https://spigotdesign.com/smooth-scroll-offset-anchor-links-with-css/ /// @param {Number} $offset Offset value /// @example /// html { /// @include smooth-anchors(10px); /// } @mixin smooth-anchors($offset) { scroll-behavior: smooth; :target:before { content: ''; display: block; height: $offset; margin: -$offset 0 0; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.