Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/lib/components/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
}
Expand Down
13 changes: 8 additions & 5 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading