Refactor (1/N): extract inline CSS into css/styles.css#22
Merged
Conversation
First step of splitting the large index.html into smaller files. Pure move: the ~1,240-line <style> block is now css/styles.css, linked via <link rel="stylesheet">. No rules changed. Works unchanged for both the Electron app (loadFile) and the static website (relative path). Also add css/**/* to the electron-builder files allowlist so the packaged desktop app includes the stylesheet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of incrementally splitting the very large
index.htmlinto smaller files (Tier 1: plain<link>/<script src>, no bundler — works identically for the Electron app and the static website, and keeps all inline event handlers working).This PR
<style>block intocss/styles.css, linked with<link rel="stylesheet" href="css/styles.css">. Pure move — no CSS rules changed (the diff is 1,239 lines out ofindex.html, 1,239 into the new file).css/**/*to thebuild.filesallowlist inpackage.jsonso the packaged Electron app ships the stylesheet (it isn't covered by the existing entries).index.htmldrops from 5,931 → 4,693 lines.Testing
<script>blocks still pass a JS syntax check (unchanged).package.jsonvalidates as JSON.npm startto confirm styling is intact (relative path resolves the same in Electron and the browser).Next steps (separate PRs)
Split the ~4,100-line inline script into feature files (
js/selection.js,js/orbitals.js,js/xyz-editor.js,js/elemco.js,js/xtb.js, etc.) as classic scripts sharing global scope, and consolidate the duplicate function definitions currently split betweenrenderer.jsand the inline script.🤖 Generated with Claude Code