Repository navigation
Custom Scrollbar API Review (#4073) - #4221
Conversation
* Custom scrollbar feature * Update .net section * Update doc * Enum naming fix Co-authored-by: David Risney <[email protected]> * Update doc and naming * Fix typo. Remove default style since user won't toggle it once style is set * Still provide default value * Update background section Co-authored-by: David Risney <[email protected]> * Update Naming Co-authored-by: David Risney <[email protected]> * Update .NET naming Co-authored-by: David Risney <[email protected]> * Update enum naming to exclude windows since its windows only feature/enum * Update doc with link to fluent ui * Update API naming --------- Co-authored-by: Diana Qu <[email protected]> Co-authored-by: David Risney <[email protected]>
Viktoria Zlatinova (vickiez)
left a comment
There was a problem hiding this comment.
Approved with suggestions
David Risney (david-risney)
left a comment
There was a problem hiding this comment.
Please update per feedback. Thanks!
Co-authored-by: Viktoria Zlatinova <[email protected]>
Co-authored-by: Viktoria Zlatinova <[email protected]>
Co-authored-by: Viktoria Zlatinova <[email protected]>
Co-authored-by: Raymond Chen <[email protected]>
|
I have a couple of questions and remarks on this proposal. What is "FluentOverlay"?As far as I know, there is no such thing like a "Fluent Background". Part of the Fluent design are two kinds of background "materials": WinUI3 provides built-in support for using all three variants as backdrop material in an application. So I wonder what the intended behavior of setting Light and Dark Styles?An application may offer its own selection for light and dark style. It does not need to follow the system setting. Window Position DependencyThis is more of a technical question regarding the implementation: The background material content is different on depending on the window position on screen. How is that supposed to be implemented, i.e. how will the WebView2 know its position relatiove to the desktop? Or is it just about making scrollbars transparent (see my next post)? In that case, it should probably just named "TransparentOverlay" or similar. |
Transparent ScrollbarsI have already been able to achieve this effect with WebView2: The ingredients for making it work like this:
This all works fine. IMO, there's much more value in being able to make (the original) scrollbars transparent and show the background that exists underneath than to have them use a fixed backdrop material which might not always be "the right" background. There's just a major flaw in the spec for scrollbar-color: It only lets you specify both, background and element color (for thumb and buttons), but often you do not know the right element color - you just want to make the background transparent. .scroller {
overflow-y: scroll;
scrollbar-color: #007 transparent;
}The first is the thumb color, the second is the background. The spec allow to specify I wonder whether there's any keyword that can be used for the first color to use the original system color for the scrollbar elements? Another unfortunate behavior is that using scrollbar-overlay also disables the hover-effect on scrollbars. |
|
softworkz Thanks for providing your feedback. The API is designed to be extendable to support new scrollbar styles that developers want. The currently supporting one is not transparent scrollbar, but more a windows style overlay scrollbar which is hidden when no user action and appears "transparent" when user is scrolling. If you have more styles that you want to support, feel free to submit a feature request. If you have your own customized scrollbar style, I believe those can be achieved by CSS. Your suggestions sounds like a different API, so feel free to make it as feature request as well and we will look into it. |
|
The name "Fluent Overlay" has brought on a wrong track. I assumed it would about having scrollbars showing the Mica background of a window backdrop. |
|
Partially yes. This COREWEBVIEW2_SCROLLBAR_STYLE_FLUENT_OVERLAY style allow the scrollbar to represent in the left picture way when scrolling and right picture way when hover over. This API allow developers to chose what the scrollbar style. It just that only one style is currently supported and more will be added in the future |
|
There's also an OS setting to control scrollbar behavior (Accessibility >> Visual Effects: Always show scrollbars). It might need consideration which setting will take precedence. Regarding the API spec, I'm wondering whether it shouldn't be defined as Flags (having values like 1, 2, 4, 8, -- and the C# enum attributed with |



Custom Scrollbar API review