Skip to content

Inline and lazy-load EasyMDE CSS, fix border colors#36714

Merged
silverwind merged 4 commits intogo-gitea:mainfrom
silverwind:easyfix
Feb 26, 2026
Merged

Inline and lazy-load EasyMDE CSS, fix border colors#36714
silverwind merged 4 commits intogo-gitea:mainfrom
silverwind:easyfix

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Feb 22, 2026

Replace the external easymde.min.css import with an inlined and lazy-loaded CSS file that uses proper theme variables for border colors. All EasyMDE/CodeMirror rules are scoped under .EasyMDEContainer, removing the need for !important overrides.

  • Fixes easymde borders, these were broken since a while now
  • Scope all easymde styles to .EasyMDEContainer
  • Inline easymde.min.css and codemirror.css into web_src/css/easymde.css
  • Lazy-load the CSS alongside the JS in switchToEasyMDE()
  • Fix .editor-toolbar and .CodeMirror border colors to use --color-input-border matching textarea inputs
  • Remove unused gutter, line number, and other unconfigured styles
  • Move .editor-loading to codeeditor.css where it belongs
image

Replace the external easymde.min.css import with an inlined and
lazy-loaded CSS file that uses proper theme variables for border
colors. All EasyMDE/CodeMirror rules are scoped under
.EasyMDEContainer, removing the need for !important overrides.

- Inline easymde.min.css and codemirror.css into web_src/css/easymde.css
- Lazy-load the CSS alongside the JS in switchToEasyMDE()
- Fix .editor-toolbar and .CodeMirror border colors to use
  --color-input-border matching textarea inputs
- Scope dark theme CodeMirror overrides under .EasyMDEContainer
- Remove unused gutter, line number, and other unconfigured styles
- Move .editor-loading to codeeditor.css where it belongs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 22, 2026
@silverwind silverwind requested a review from Copilot February 22, 2026 20:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes EasyMDE styling by inlining and lazy-loading the EasyMDE/CodeMirror CSS at the point where EasyMDE is enabled, while also aligning editor border colors with the app’s theme input border variables and reducing global style leakage.

Changes:

  • Remove global EasyMDE CSS import and lazy-load the new easymde.css alongside the EasyMDE JS chunk.
  • Inline and scope EasyMDE + CodeMirror base styles under .EasyMDEContainer, using theme variables (notably for borders).
  • Scope CodeMirror dark-theme token colors under .EasyMDEContainer and relocate .editor-loading styling to codeeditor.css.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web_src/js/index-domready.ts Removes global EasyMDE CSS import to enable lazy-loading.
web_src/js/features/comp/ComboMarkdownEditor.ts Lazy-loads EasyMDE CSS together with the EasyMDE JS import.
web_src/css/index.css Drops always-on imports for CodeMirror base and the old file editor CSS.
web_src/css/features/codeeditor.css Adds .editor-loading base styling after moving it out of editor-specific CSS.
web_src/css/editor/fileeditor.css Removes old global EasyMDE toolbar/preview/statusbar styling (now handled elsewhere).
web_src/css/easymde.css New inlined + scoped EasyMDE/CodeMirror stylesheet loaded on-demand.
web_src/css/codemirror/dark.css Scopes dark theme CodeMirror token colors to .EasyMDEContainer to avoid global leakage.
web_src/css/codemirror/base.css Removes old scoped overrides now incorporated into easymde.css.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

silverwind and others added 2 commits February 22, 2026 22:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: silverwind <me@silverwind.io>
The ::before/::after rules on .editor-toolbar.fullscreen never had a
content declaration, so they were never rendered. Remove them entirely
rather than trying to fix them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 25, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 26, 2026
@silverwind silverwind enabled auto-merge (squash) February 26, 2026 10:48
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 26, 2026
@silverwind silverwind merged commit 0d00629 into go-gitea:main Feb 26, 2026
26 checks passed
@silverwind silverwind deleted the easyfix branch February 26, 2026 10:50
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 26, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 26, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 26, 2026
* main: (24 commits)
  Instance-wide (global) info banner and maintenance mode (go-gitea#36571)
  Add created_by filter to SearchIssues (go-gitea#36670)
  Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714)
  Fix release draft access check logic (go-gitea#36720)
  Change image transparency grid to CSS (go-gitea#36711)
  Avoid opening new tab when downloading actions logs (go-gitea#36740)
  Add validation constraints for repository creation fields (go-gitea#36671)
  Fix SVG height calculation in diff viewer (go-gitea#36748)
  Fix path resolving (go-gitea#36734)
  [skip ci] Updated translations via Crowdin
  Fix track time list permission check (go-gitea#36662)
  Fix incorrect setting loading order (go-gitea#36735)
  Use case-insensitive matching for Git error "Not a valid object name" (go-gitea#36728)
  feat: Add workflow dependencies visualization (go-gitea#36248)
  Add keyboard shortcuts for repository file and code search (go-gitea#36416)
  Refactor text utility classes to Tailwind CSS (go-gitea#36703)
  Prevent redirect bypasses via backslash-encoded paths (go-gitea#36660)
  Fix force push time-line commit comments of pull request (go-gitea#36653)
  Fix get release draft permission check (go-gitea#36659)
  Move `X_FRAME_OPTIONS` setting from `cors` to `security` section (go-gitea#30256)
  ...

# Conflicts:
#	web_src/css/base.css
#	web_src/css/index.css
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 27, 2026
* giteaofficial/main:
  Filter out untracked files from spellchecking (go-gitea#36756)
  Fix CSS stacking context issue in actions log (go-gitea#36749)
  Fix milestone/project text overflow in issue sidebar (go-gitea#36741)
  Update tool dependencies and fix new lint issues (go-gitea#36702)
  Instance-wide (global) info banner and maintenance mode (go-gitea#36571)
  Add created_by filter to SearchIssues (go-gitea#36670)
  Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714)
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 27, 2026
* origin/main:
  Move Fomantic dropdown CSS to custom module (go-gitea#36530)
  Use "Enable Gravatar" but not "Disable" (go-gitea#36771)
  feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743)
  Deprecate RenderWithErr (go-gitea#36769)
  Lazy-load some Vue components, fix heatmap chunk loading on every page (go-gitea#36719)
  Filter out untracked files from spellchecking (go-gitea#36756)
  Fix CSS stacking context issue in actions log (go-gitea#36749)
  Fix milestone/project text overflow in issue sidebar (go-gitea#36741)
  Update tool dependencies and fix new lint issues (go-gitea#36702)
  Instance-wide (global) info banner and maintenance mode (go-gitea#36571)
  Add created_by filter to SearchIssues (go-gitea#36670)
  Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714)

# Conflicts:
#	templates/repo/issue/view_content/pull_merge_box.tmpl
#	web_src/js/features/repo-issue-pull.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants