How to apply overscroll-behaviour property to the body?

I am trying to apply the CSS property overscroll-behavior to my sites, in order to avoid the “bounce” effect when scrolling over the start and end of pages.
Usually adding overscroll-behavior: none; to the body tag should work (e.g. in Webflow I can add this attribute to the body tag and it works), but it seems to have no effect with Bricks. Or maybe I am doing it wrong.

I tried it on the header element like this:

%root% { overscroll-behavior: none; }

as well as adding it to Bricks custom CSS globally like this:

body { overscroll-behavior: none; }

or even

* { overscroll-behavior: none; }

But nothing seems to have any effect.
Thanks for your help!

body {
    overscroll-behavior: none;
}

works for me. make sure you don’t have any other CSS overridding it. On standard Bricks install, just that CSS rule should work.

I̶ ̶t̶h̶i̶n̶k̶ ̶I̶ ̶f̶i̶g̶u̶r̶e̶d̶ ̶i̶t̶ ̶o̶u̶t̶,̶ ̶i̶t̶ ̶w̶a̶s̶ ̶i̶n̶ ̶f̶a̶c̶t̶ ̶A̶u̶t̶o̶m̶a̶t̶i̶c̶.̶c̶s̶s̶ ̶w̶h̶i̶c̶h̶ ̶i̶s̶ ̶o̶v̶e̶r̶r̶i̶d̶i̶n̶g̶ ̶a̶n̶y̶ ̶c̶u̶s̶t̶o̶m̶ ̶C̶S̶S̶ ̶t̶h̶a̶t̶ ̶I̶ ̶w̶o̶u̶l̶d̶ ̶a̶d̶d̶ ̶t̶o̶ ̶t̶h̶e̶ ̶̶̶b̶o̶d̶y̶̶̶ ̶t̶a̶g̶ ̶i̶n̶ ̶t̶h̶e̶ ̶B̶r̶i̶c̶k̶s̶ ̶s̶e̶t̶t̶i̶n̶g̶s̶.̶

Edit: Found a workaround. If added as Custom CSS in the builder directly, it will work fine.

So adding:

body { overscroll-behavior: none; }

to my header template (which is present on all pages) did the trick.

Or so I thought… I spoke to ACSS devs and they assured me ACSS is not interfering with overscroll in any capacity. I also did some more testing and found out that I can add ANY other property to the body through global custom CSS just fine, but overscroll-behaviour is simply not executed on the front end CSS.

Could this be a bug? I don’t understand.

I see this when adding to the custom CSS in Bricks Settings:
Bildschirmfoto 2024-03-12 um 16.02.35

But this will work fine through Custom Code within the builder:
Bildschirmfoto 2024-03-12 um 16.04.05

Someone make it make sense please? :sweat_smile:

You’re spelling ‘behaviour’ differently in each example.

1 Like

Omg… Thanks. So obvious but I couldn’t see it. Didn’t ever realise mixing up BE with AE spelling would break code (I’m not a native speaker). But of course, it all needs to be in american spelling :sweat_smile: