gitea/web_src/css
silverwind e2e8509239
Replace Monaco with CodeMirror (#36764)
- Replace monaco-editor with CodeMirror 6
- Add `--color-syntax-*` CSS variables for all syntax token types,
shared by CodeMirror, Chroma and EasyMDE
- Consolidate chroma CSS into a single theme-independent file
(`modules/chroma.css`)
- Syntax colors in the code editor now match the code view and
light/dark themes
- Code editor is now 12px instead of 14px font size to match code view
and GitHub
- Use a global style for kbd elements
- When editing existing files, focus will be on codemirror instead of
filename input.
- Keyboard shortcuts are roughtly the same as VSCode
- Add a "Find" button, useful for mobile
- Add context menu similar to Monaco
- Add a command palette (Ctrl/Cmd+Shift+P or F1) or via button
- Add clickable URLs via Ctrl/Cmd+click
- Add e2e test for the code editor
- Remove `window.codeEditors` global
- The main missing Monaco features are hover types and semantic rename
but these were not fully working because monaco operated only on single
files and only for JS/TS/HTML/CSS/JSON.

| | Monaco (main) | CodeMirror (cm) | Delta |
|---|---|---|---|
| **Build time** | 7.8s | 5.3s | **-32%** |
| **JS output** | 25 MB | 14 MB | **-44%** |
| **CSS output** | 1.2 MB | 1012 KB | **-17%** |
| **Total (no maps)** | 23.3 MB | 12.1 MB | **-48%** |

Fixes: #36311
Fixes: #14776
Fixes: #12171

<img width="1333" height="555" alt="image"
src="https://github.com/user-attachments/assets/f0fe3a28-1ed9-4f22-bf25-2b161501d7ce"
/>

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2026-03-31 21:50:45 +00:00
..
editor Inline and lazy-load EasyMDE CSS, fix border colors (#36714) 2026-02-26 10:50:44 +00:00
features Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
markup Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
modules Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
repo Fix vertical alignment of `.commit-sign-badge` children (#36570) 2026-02-11 01:01:26 +00:00
shared Refactor some trivial problems (#34959) 2025-07-05 23:19:33 +08:00
standalone Enable native dark mode for swagger-ui (#36899) 2026-03-14 09:50:23 +01:00
themes Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
actions.css Misc CSS fixes (#34638) 2025-06-07 19:57:07 +02:00
admin.css Instance-wide (global) info banner and maintenance mode (#36571) 2026-02-26 23:16:11 +08:00
base.css Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
dashboard.css Refactor text utility classes to Tailwind CSS (#36703) 2026-02-22 22:56:33 +00:00
easymde.css Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
explore.css
font_i18n.css
helpers.css
home.css Fix theme discovery and Vite dev server in dev mode (#37033) 2026-03-30 14:59:10 +00:00
index.css Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
install.css
org.css
repo.css Replace Monaco with CodeMirror (#36764) 2026-03-31 21:50:45 +00:00
review.css Misc CSS fixes (#35888) 2025-11-19 03:02:41 +00:00
user.css Add user badges (#36752) 2026-03-22 15:49:45 +00:00