github varabyte/kobweb v0.19.2

latest releases: v0.24.0, v0.23.3, v0.23.2...
19 months ago

This release is nearly identical to v0.19.1 but contains a fix for a logic error introduced there that affected scrolling to fragments on the same page.

For example, if your project had code like this:

Link("#conclusion", "Click here to jump to the conclusion")

clicking on that link would have no effect.

If you are using v0.19.1, you should consider upgrading to v0.19.2 at your earliest convenience.

Important

Planning to upgrade? Review instructions in the README.


⚠️ Smooth scrolling behavior has changed ⚠️

In addition to our fix, we also removed some opinionated smooth scrolling behavior we used when navigating to fragments that we probably shouldn't have added in the first place.

What this means is, after upgrading to 0.19.2, if you have any pages in your site with internal links, navigation to them will now be instant, snapping immediately to the target element when you click a link. This is the browser's (and many sites') default behavior.

(For example, try clicking around on the section links in the sidebar of this Wikipedia page to see instant navigation in action.)

If you'd like to go back to re-enabling smooth scrolling in your site, we recommend adding this somewhere in your site, for example in your AppEntry.kt file:

@InitSilk
fun enableSiteWideSmoothScrolling(ctx: InitSilkContext) = ctx.stylesheet.apply {
    registerStyle("html") {
        cssRule(CSSMediaQuery.MediaFeature("prefers-reduced-motion", StylePropertyValue("no-preference"))) {
            Modifier.scrollBehavior(ScrollBehavior.Smooth)
        }
    }
}

What the above code does is set the site's scroll behavior to "smooth" unless some accessibility setting has been set on that user's machine indicating they don't want it. This approach is an encouraged best practice for enabling smooth scrolling.


Full Changelog: v0.19.1...v0.19.2

Don't miss a new kobweb release

NewReleases is sending notifications on new releases.