Document index.css consistently - #84
Open
ZayanKhan-12 wants to merge 2 commits into
Open
ZayanKhan-12 wants to merge 2 commits into
ZayanKhan-12 wants to merge 2 commits into
Conversation
The stylesheet had five comments across 274 lines, in two different styles, and they named sections without saying what the rules were for. Several blocks that are easy to get wrong carried nothing at all. Adds a file header recording what the sheet styles and, importantly, that IndexView loads it after bootstrap.min.css: most rules here exist to override a Bootstrap default, so one that looks redundant usually is not. Each block now has a comment in one consistent form covering what it styles, where the markup comes from, and what it is coupled to. The couplings are the reason for most of this. The sidebar width is repeated as four values that have to change together (#sidebar width, #wrapper.toggled margin-left, #toggle left, #contents margin-left), the collapse transition is duplicated across three selectors that have to stay in sync, and both the "toggled" and "active" classes are applied elsewhere -- by index.js and by IndexView respectively -- which is not discoverable from the stylesheet alone. Selectors that never appear in this repository's templates are noted rather than left to look dead: .popover-content is generated by Bootstrap's JavaScript, and the .tabs-right and .tabs-below variants complete a set that services built on Twitter Server can use, of which StackRegistryView only renders .tabs-left. Comments only. Verified by stripping every comment from the file before and after and confirming the remaining CSS is identical. Fixes twitter#78 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
.glyphicon-refresh-animate declared "-animation". A vendor prefix has to name a vendor, so "-animation" matched nothing and browsers dropped the declaration, leaving only the -webkit- rule. The spinner turned in Chrome and Safari and sat motionless in Firefox. Confirmed by parsing the declaration with a CSS engine: "-animation" is discarded while "animation" and "-webkit-animation" are kept. The @Keyframes spin rule it refers to was already present and, until now, unreachable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ZayanKhan-12
pushed a commit
to ZayanKhan-12/twitter-server
that referenced
this pull request
Sep 17, 2026
Document index.css consistently (fixes twitter#78) Co-Authored-By: Claude Opus 5 (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.
Fixes #78.
index.csshad five comments across 274 lines, written in two different styles (/** x */and/** x **/), and they named sections without saying what the rules were for. Several blocks that are easy to get wrong carried nothing at all — which is what @nikhilpatil123 reported.What the comments now say
Rather than restating the declarations, each block records what it styles, where its markup comes from, and what it is coupled to. The couplings are the reason most of this is worth writing down:
#sidebarwidth250px,#wrapper.toggledmargin-left-250px,#toggleleft250px, and#contentsmargin-left270px. Changing one alone misaligns the layout.#wrapper,#sidebar,#toggle) and has to stay in sync for them to animate together.index.jstogglestoggledon#wrapper;IndexView.renderNavsetsactiveon the nav group containing the current page. Neither is discoverable from the stylesheet.The file header records something that is not obvious and changes how you read the whole sheet:
IndexViewloads this afterbootstrap.min.css, so most rules exist to override a Bootstrap default. A rule that looks redundant usually is not — deleting it restores the Bootstrap appearance rather than changing nothing.I also noted the selectors that appear nowhere in this repository's templates, so they don't read as dead code.
.popover-contentis generated by Bootstrap's own JavaScript, and.tabs-right/.tabs-belowcomplete a set that services built on Twitter Server can use, of whichStackRegistryViewrenders only.tabs-left.Grounded in
IndexView.scala,index.jsandStackRegistryView.scalarather than inferred from selector names, so the comments describe what the code actually does.Second commit: a bug found while documenting it
The spinner rule declared
-animation. A vendor prefix has to name a vendor, so-animationmatched nothing, browsers discarded the declaration, and only the-webkit-rule applied — the refresh spinner turned in Chrome and Safari and sat motionless in Firefox. The@keyframes spinrule it referenced was already present and, until now, unreachable.Confirmed by parsing the declaration with a CSS engine:
It is a one-word change and the only behaviour change in this PR, so it is a separate commit — drop it if you would rather keep this documentation-only, and I will open it on its own.
Verification
The documentation commit changes no behaviour, and I checked that rather than asserting it: stripping every comment from the file before and after leaves byte-identical CSS.
The stylesheet parses without errors (50 rules and at-rules) both before and after.
I could not run
sbt clean test— there is no JVM on this machine, and CI's build also needstwitter/dodo-buildto build the dependency chain.index.cssis served as a static resource from/admin/files/css/, so nothing compiles against it, but the Scala suite is unrun on my side and needs CI to confirm.I have not added a
CLAUDE.md. Writing one that is actually useful means understanding the sbt/Bazel build and the Scala cross-version setup, and I could not build the project here; a file guessing at that would be worse than none.