这是indexloc提供的服务,不要输入任何密码
Skip to content

Use scroll-behavior: smooth instead of smoothscroll-polyfill? #436

@aozaki-kuro

Description

@aozaki-kuro

I checked recently and found scroll-behavior: smooth; should be supported by most modern browsers
https://caniuse.com/css-scroll-behavior

I removed smoothscroll-polyfill from package.json and added this to tailwind.css

html {
  scroll-behavior: smooth;
}

In tailwindcss it should be

html {
  @apply scroll-smooth;
}

and it worked totally fine here.

In case of motion sickness another line should be included according to this article

html {
  @apply scroll-smooth motion-reduce:scroll-auto;
}

Maybe we should consider remove the package and use the smooth scroll css instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions