Skip to content

refactor(ui): extract inline CSS to src/static/css/main.css#15

Merged
Killea merged 1 commit intoKillea:mainfrom
bertheto:refactor/extract-css
Mar 1, 2026
Merged

refactor(ui): extract inline CSS to src/static/css/main.css#15
Killea merged 1 commit intoKillea:mainfrom
bertheto:refactor/extract-css

Conversation

@bertheto
Copy link
Contributor

@bertheto bertheto commented Mar 1, 2026

Problem

The entire CSS for the web console (1572 lines) lived inside a single <style> block in index.html, making the file 2508 lines long and very hard to navigate and edit.

Changes

  • Extract all CSS from the <style> block in index.html into a new file src/static/css/main.css
  • Replace the <style> block with
  • Remove the 4-space indent inherited from the HTML context
  • index.html reduced from 2508 to 935 lines
  • src/static/css/main.css created (1572 lines)
  • FastAPI already mounts src/static/ recursively via StaticFiles, so no server changes needed

No functional changes

All styles are identical; only the delivery mechanism changed (external file vs inline). Browser cache benefits from the separate asset.

Tests

  • Vitest unit tests: 18/18 passed
  • Python unit tests (pytest): 54/54 passed

Move 1572 lines of CSS from the embedded style block in index.html
to a dedicated src/static/css/main.css file, served by FastAPI's
existing StaticFiles mount at /static.

- Replace style block with link rel=stylesheet href=/static/css/main.css
- Remove 4-space indent inherited from HTML context
- index.html reduced from 2508 to 935 lines
- No logic changes; browser cache now benefits from a separate CSS asset
@Killea Killea force-pushed the refactor/extract-css branch from 535c205 to ef8e69b Compare March 1, 2026 12:50
@Killea Killea merged commit cff2513 into Killea:main Mar 1, 2026
1 check passed
@bertheto bertheto deleted the refactor/extract-css branch March 1, 2026 14:57
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.

2 participants