Skip to content

fix(web): editor icons + subtler toolbar hover#9

Merged
SwathiMystery merged 1 commit intomainfrom
fix/editor-styling
Apr 21, 2026
Merged

fix(web): editor icons + subtler toolbar hover#9
SwathiMystery merged 1 commit intomainfrom
fix/editor-styling

Conversation

@SwathiMystery
Copy link
Copy Markdown
Contributor

What

Two cosmetic issues in the rich-notes editor: toolbar buttons were blank (missing FontAwesome) and hover/active painted buttons amber.

Why

  • EasyMDE's CSS expects FontAwesome on the page. We disabled `autoDownloadFontAwesome` (correct — it would inject a CDN link) but didn't provide FA ourselves, so every toolbar button rendered as a blank 24px square.
  • The previous hover rule flooded the whole button with the accent colour, overriding the icon and feeling loud.

Changes

  • Vendor FontAwesome 4.7 locally under `khata/web/static/vendor/fontawesome/` — CSS, all font files (woff2, woff, ttf, svg, eot, otf), plus a LICENSE.txt covering icons / fonts / CSS.
  • URL rewrite at vendor time — CSS font URLs rewritten from `../fonts/` to an absolute `/static/vendor/fontawesome/` so paths resolve regardless of how `/static` is mounted.
  • Base template now loads `font-awesome.min.css` before `easymde.min.css`.
  • Toolbar button states reworked: subtle 1px border + surface background on hover, accent-coloured icon (not background) for active state. CodeMirror, preview, and statusbar tuned for readability in both light and dark modes.

Verification

GET /static/vendor/fontawesome/font-awesome.min.css       → 200  30 KB
GET /static/vendor/fontawesome/fontawesome-webfont.woff2  → 200  75 KB
GET /static/vendor/fontawesome/fontawesome-webfont.woff   → 200  95 KB

Font URLs in the CSS all point to `/static/vendor/fontawesome/` — no maxcdn references.

No-CDN posture preserved

The editor still loads zero external assets at runtime. `autoDownloadFontAwesome: false` stays.

Checklist

  • 46/46 tests green
  • `uv run ruff check khata tests` clean
  • `uv run ruff format khata tests` applied
  • No schema change
  • LICENSE.txt committed alongside vendored fonts

Two problems in the rich-notes editor:
1. Toolbar buttons rendered as blank squares — EasyMDE's CSS expects
   FontAwesome on the host page but 'autoDownloadFontAwesome: false'
   in editor.js meant nothing ever loaded. (Keeping autoDownload off
   is correct: it would inject a CDN <link> at runtime, against our
   no-CDN posture.)
2. Hover + active button states painted the whole button amber —
   loud and hard to read the icon.

Fix
- Vendor FontAwesome 4.7 locally under static/vendor/fontawesome/
  (CSS + all font files + licence). URLs in the CSS rewritten from
  '../fonts/' to an absolute '/static/vendor/fontawesome/' so paths
  resolve regardless of how a user mounts /static.
- Base template now loads font-awesome.min.css before easymde.min.css
  so toolbar icons render: bold, italic, heading, quote, lists, link,
  image, code, preview, side-by-side, guide.
- Hover state: background flips to surface, icon takes the foreground
  colour, subtle 1px border — no more amber flood.
- Active state: surface background, accent-coloured icon, same border.
- Tidied up CodeMirror, preview, and statusbar colours so they read
  cleanly in both light and dark modes.

Not changed
- Vendored editor is still served from /static/vendor; no new
  outbound network calls at runtime.
- Existing 46 tests still green.
@SwathiMystery SwathiMystery merged commit 7bb157e into main Apr 21, 2026
7 checks passed
@SwathiMystery SwathiMystery deleted the fix/editor-styling branch April 21, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant