Kalan's Blog

Software Engineer / Taiwanese / Life in Fukuoka

Current Theme light

When I happily implemented smooth-scroll using Svelte, I discovered that it can actually be achieved with just one line of CSS:

html {
  scroll-behavior: smooth;
}

Apart from concerns about browser support, this completely eliminates the hassle of developers importing libraries or implementing it themselves.

Screenshot_2020-05-07 scroll-behavior

Perfectly achieving smooth-scroll without the need to modify hashchange and state change behaviors. I will write an article someday on how to achieve smooth-scroll without using CSS.

Prev

How to bring Github Actions to your project

Next

Write a JSON parser from scratch (1)

If you found this article helpful, please consider buy me a drink ☕️ It'll make my ordinary day shine✨

Buy me a coffee

作者

Kalan 頭像照片,在淡水拍攝,淺藍背景

愷開 | Kalan

Hi, I'm Kai. I'm Taiwanese and moved to Japan in 2019 for work. Currently settled in Fukuoka. In addition to being familiar with frontend development, I also have experience in IoT, app development, backend, and electronics. Recently, I started playing electric guitar! Feel free to contact me via email for consultations or collaborations or music! I hope to connect with more people through this blog.