microsoft / monaco-editor

A browser based code editor
https://microsoft.github.io/monaco-editor/
MIT License
39.98k stars 3.57k forks source link

[Feature Request] Rounded scroll bar #4374

Open Wissperwind opened 7 months ago

Wissperwind commented 7 months ago

Context

Description

Hi

I included the monaco editor in my website. But the website use modern style rounded scrollbars. Like this:

*::-webkit-scrollbar {
    width: 16px;
}

*::-webkit-scrollbar-track {
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
    height: 56px;
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: content-box;
    background-color: #888;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

It does no look good if the whole website has rounded scrollbars, but the editor has thick square ones. Can you please provide an option for rounded scrollbars?

302550609-4aa7e50e-0352-4fbe-a2bc-9056e6e4a13e

Monaco Editor Playground Link

No response

Monaco Editor Playground Code

No response

paustint commented 6 months ago

I did some very basic poking around on the playground and looks like the scrollbars are hand-rolled and are not native browser scrollbars, so you can most likely use normal CSS to style these (as demonstrated in the demo)

.monaco-editor .monaco-scrollable-element .scrollbar.horizontal, .monaco-editor .decorationsOverviewRuler, .monaco-editor .monaco-scrollable-element .scrollbar.vertical .arrow-background

You will need to figure out what classes to target - but it is all here in the browser for your exploration and customization.

image
Wissperwind commented 6 months ago

So there are two types of Scrollbars widely used: The Win 10 Style Block ones often with arrwos and the round ones withour arrwos.

You see examples in your screenshot.

How about the idea to make a switch in the monaco editor wether you like the square ones ore the thin rounded ones? With the rounded scroll thumb I mean. That would make it easier for developers to get the right scrollbar for their needs.

Web-Dev-Machina commented 5 months ago

Rounded corners:

.monaco-editor { border-radius: 10px; } .overflow-guard { border-radius: 10px; }

Rounded slide-bar:

.slider { border-radius: 10px; }

AzureIP commented 2 months ago

border-radius: 10px; makes them rounded. One step done. Can you also tell me what options to change, to make them half as thick and to increase the opacity? Is it possible to let the text end at the scrollbar?