Skip to content

Commit 09d28c7

Browse files
Add styling to allow for scrollbars to be themed in Chrome (#1233)
closes RaspberryPiFoundation/digital-editor-issues#776
1 parent e5d90c0 commit 09d28c7

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2020

2121
- Improved status bar styling (#1221)
2222
- Added horizontal scrollbar to editor (#1228)
23+
- Add theme for scrollbars (#1233)
2324

2425
## [0.30.1] - 2025-06-09
2526

src/assets/stylesheets/App.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ input {
3030
background-color: $rpf-teal-100;
3131
color: $rpf-text-primary;
3232
caret-color: $rpf-black;
33+
color-scheme: light;
34+
3335

3436
.pythonrunner-input {
3537
color: rgb(36, 103, 236);
@@ -44,6 +46,7 @@ input {
4446
background-color: $rpf-grey-900;
4547
color: $rpf-white;
4648
caret-color: $rpf-white;
49+
color-scheme: dark;
4750

4851
.pythonrunner-input {
4952
color: rgb(36, 186, 236);

src/assets/stylesheets/EditorPanel.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
@use "./rpf_design_system/spacing" as *;
22
@use "./rpf_design_system/font-size" as *;
33

4+
// Scrollbar-width is needed from scrollbar to show in Chrome
5+
.editor-wrapper {
6+
// Needed here for vertical scroll
7+
overflow: auto;
8+
scrollbar-width: thin;
9+
}
10+
411
.editor {
512
display: flex;
613
flex-flow: column;
@@ -16,6 +23,7 @@
1623
}
1724

1825
.cm-scroller {
26+
// Needed here for horizontal scroll
1927
overflow: auto;
2028
scrollbar-width: thin;
2129
overscroll-behavior-x: none;

src/components/Editor/EditorPanel/EditorPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const EditorPanel = ({ extension = "html", fileName = "index" }) => {
164164
}, [file, cascadeUpdate, editorViewRef]);
165165

166166
return (
167-
<>
167+
<div className="editor-wrapper">
168168
<div className={`editor editor--${settings.fontSize}`} ref={editor}></div>
169169
{characterLimitExceeded && (
170170
<Alert
@@ -175,7 +175,7 @@ const EditorPanel = ({ extension = "html", fileName = "index" }) => {
175175
})}
176176
/>
177177
)}
178-
</>
178+
</div>
179179
);
180180
};
181181

0 commit comments

Comments
 (0)