diff --git a/src/lib/components/Editor.svelte b/src/lib/components/Editor.svelte index 674906af..997c91c7 100644 --- a/src/lib/components/Editor.svelte +++ b/src/lib/components/Editor.svelte @@ -923,22 +923,9 @@ min-width: 0; } - /* Monaco sizes the slider inline. Grow it under the pointer the way the - preview's thumb does. */ + /* Same corner as the preview's thumb in styles.css. */ .editor-container :global(.monaco-scrollable-element > .scrollbar > .slider) { - border-radius: 10px; - } - - .editor-container :global(.monaco-scrollable-element > .scrollbar.vertical > .slider:hover), - .editor-container :global(.monaco-scrollable-element > .scrollbar.vertical > .slider.active) { - width: 12px !important; - left: 1px !important; - } - - .editor-container :global(.monaco-scrollable-element > .scrollbar.horizontal > .slider:hover), - .editor-container :global(.monaco-scrollable-element > .scrollbar.horizontal > .slider.active) { - height: 12px !important; - top: 1px !important; + border-radius: 4px; } :global(.ghost-caret) { diff --git a/src/lib/utils/editorOptions.ts b/src/lib/utils/editorOptions.ts index 0145322a..adc80714 100644 --- a/src/lib/utils/editorOptions.ts +++ b/src/lib/utils/editorOptions.ts @@ -237,8 +237,8 @@ export function createdEditorOptions( // Same track and thumb as the preview's ::-webkit-scrollbar in styles.css. verticalScrollbarSize: 14, horizontalScrollbarSize: 14, - verticalSliderSize: 8, - horizontalSliderSize: 8, + verticalSliderSize: 12, + horizontalSliderSize: 12, }, }; } diff --git a/src/styles.css b/src/styles.css index 23f9c375..61ee8c4f 100644 --- a/src/styles.css +++ b/src/styles.css @@ -211,19 +211,22 @@ body { background: transparent; } -/* 8px at rest, 12px under the pointer, between the Windows and macOS thumbs. - Keep in step with the Monaco scrollbar in Editor.svelte. */ +/* A 12px thumb that keeps its width and only darkens under the pointer, as + Monaco's does, with Fluent's 4px control corner (5px less the 1px + transparent border). 22px is Monaco's 20px minimum slider length plus that + border at each end. Keep in step with the Monaco scrollbar in Editor.svelte. */ ::-webkit-scrollbar-thumb { background-color: rgba(120, 120, 120, 0.35); - border-radius: 10px; - border: 3px solid transparent; + border-radius: 5px; + border: 1px solid transparent; background-clip: content-box; + min-width: 22px; + min-height: 22px; } ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: rgba(120, 120, 120, 0.55); - border-width: 1px; } .markdown-body {