Skip to content

Commit 67612d6

Browse files
committed
Disable smooth scrolling when searching on the page
1 parent 54ab5e7 commit 67612d6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

scss/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ $code-color: #e83e8c !default;
2323

2424
$lead-font-size: 1.75rem !default;
2525
$lead-font-weight: 400 !default;
26+
27+
$enable-smooth-scroll: false;

scss/main_bs5.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
// flush footer to bottom
55
html {
66
height: 100%;
7+
8+
// smooth scrolling only when clicking between sections.
9+
animation: smoothscroll1 1s;
10+
11+
&:focus-within {
12+
animation-name: smoothscroll2;
13+
scroll-behavior: smooth;
14+
}
15+
}
16+
17+
@keyframes smoothscroll1 {
18+
from,
19+
to {
20+
scroll-behavior: smooth;
21+
}
22+
}
23+
24+
@keyframes smoothscroll2 {
25+
from,
26+
to {
27+
scroll-behavior: smooth;
28+
}
729
}
830

931
body {

0 commit comments

Comments
 (0)