open-amdocs / webrix

Powerful building blocks for React-based web applications
https://webrix.amdocs.com
Apache License 2.0
432 stars 32 forks source link

Add CSS Custom Properties for CSS-Based Scrollbar Calculations #61

Closed ykadosh closed 3 years ago

ykadosh commented 3 years ago

If possible, we should try to assign various CSS properties that can later be used for calculating the scroll track size and scroll thumb position using CSS only, instead of the current JS based implementation.

The ultimate goal is to be able to use CSS only for all the calculations.

I suggest adding the following:

And on each scrollbar, the following:

Then, we can calculate the thumb size and position like so:

height: max(calc((var(--csvr, 1) * 100%)), 30px); // 30px min size, can also be a variable
udia76 commented 3 years ago

:tada: This issue has been resolved in version 1.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: