Interactivity
用於控制元素捲動行為的通用類別。
| Class | Styles |
|---|---|
scroll-auto | scroll-behavior: auto; |
scroll-smooth | scroll-behavior: smooth; |
使用 scroll-smooth 通用類別在元素內啟用平滑捲動:
<html class="scroll-smooth"> <!-- ... --></html>設定 scroll-behavior 只會影響由瀏覽器觸發的捲動事件。
使用 scroll-auto 通用類別來恢復捲動的預設瀏覽器行為:
<html class="scroll-smooth md:scroll-auto"> <!-- ... --></html>