Skip to content

Commit 0bb4c1c

Browse files
authored
Code editor theme enhancements (#31629)
1. Fixed border-radius 2. Monaco ignores the alpha channel on the shadow color, introduce `color-shadow-opaque` 3. Remove scrollbar color which follows #29800 Before: <img width="34" alt="Screenshot 2024-07-13 at 15 38 18" src="https://github.com/user-attachments/assets/042d9bde-6db9-4467-a2a4-8f61ecc773eb"> <img width="35" alt="Screenshot 2024-07-13 at 15 38 31" src="https://github.com/user-attachments/assets/04146ee0-551c-4ff2-9636-bd119b33595a"> After: <img width="45" alt="Screenshot 2024-07-13 at 15 38 06" src="https://github.com/user-attachments/assets/1f58fa5a-1289-4e45-83c9-18ca82a5e266"> <img width="39" alt="Screenshot 2024-07-13 at 21 16 56" src="https://github.com/user-attachments/assets/e12ebe22-b29b-4798-9f0d-4c100f311562">
1 parent 0f53324 commit 0bb4c1c

File tree

5 files changed

+5
-14
lines changed

5 files changed

+5
-14
lines changed

templates/repo/editor/edit.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</div>
3737
</div>
3838
<div class="ui bottom attached segment tw-p-0">
39-
<div class="ui active tab tw-rounded" data-tab="write">
39+
<div class="ui active tab tw-rounded-b" data-tab="write">
4040
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
4141
data-url="{{.Repository.Link}}/markup"
4242
data-context="{{.RepoLink}}"

web_src/css/features/codeeditor.css

+1-12
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,7 @@
2323

2424
.monaco-editor,
2525
.monaco-editor .overflow-guard {
26-
border-radius: var(--border-radius);
27-
}
28-
29-
/* these seem unthemeable */
30-
.monaco-scrollable-element > .scrollbar > .slider {
31-
background: var(--color-primary) !important;
32-
}
33-
.monaco-scrollable-element > .scrollbar > .slider:hover {
34-
background: var(--color-primary-dark-1) !important;
35-
}
36-
.monaco-scrollable-element > .scrollbar > .slider:active {
37-
background: var(--color-primary-dark-2) !important;
26+
border-radius: 0 0 var(--border-radius) var(--border-radius);
3827
}
3928

4029
/* fomantic styles destroy this element only visible on IOS, restore it */

web_src/css/themes/theme-gitea-dark.css

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
--color-button: #171a1e;
213213
--color-code-bg: #14171a;
214214
--color-shadow: #00001758;
215+
--color-shadow-opaque: #000017;
215216
--color-secondary-bg: #2a3137;
216217
--color-expand-button: #2f363d;
217218
--color-placeholder-text: var(--color-text-light-3);

web_src/css/themes/theme-gitea-light.css

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
--color-button: #f8f9fb;
213213
--color-code-bg: #fafdff;
214214
--color-shadow: #00001726;
215+
--color-shadow-opaque: #c7ced5;
215216
--color-secondary-bg: #f2f5f8;
216217
--color-expand-button: #cfe8fa;
217218
--color-placeholder-text: var(--color-text-light-3);

web_src/js/features/codeeditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function createMonaco(textarea, filename, editorOpts) {
9696
'input.background': getColor('--color-input-background'),
9797
'input.border': getColor('--color-input-border'),
9898
'input.foreground': getColor('--color-input-text'),
99-
'scrollbar.shadow': getColor('--color-shadow'),
99+
'scrollbar.shadow': getColor('--color-shadow-opaque'),
100100
'progressBar.background': getColor('--color-primary'),
101101
'focusBorder': '#0000', // prevent blue border
102102
},

0 commit comments

Comments
 (0)