Skip to content

Remove dead CSS rules#37173

Merged
silverwind merged 5 commits intogo-gitea:mainfrom
silverwind:remove-dead-css
Apr 11, 2026
Merged

Remove dead CSS rules#37173
silverwind merged 5 commits intogo-gitea:mainfrom
silverwind:remove-dead-css

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Apr 10, 2026

Remove CSS rules whose HTML classes/IDs are no longer referenced in any template, Go source, or JavaScript/TypeScript file:

  • .archived-icon: removed from templates in c85bb62
  • .bottom-line: removed from blame rendering in 9c6aeb4
  • .commit-status-link: removed from templates in f3c4baa
  • .instruct-toggle: removed from templates in 75e85c2
  • .runner-new-text, #runner-new: never referenced outside CSS
  • .ap-terminal: stale, asciinema-player uses .ap-term, still not needed
  • .scrolling.dimmable.dimmed: dimmer stand-in never adds this class
  • .markup span.align-center/align-right/float-left/float-right: never produced by any renderer, sanitizer strips class attributes
  • .markup ul.no-list, .markup ol.no-list: same as above

This PR was written with the help of Claude Opus 4.6

Remove CSS rules whose HTML classes/IDs are no longer referenced in any
template, Go source, or JavaScript/TypeScript file:

- `.archived-icon`: removed from templates in c85bb62
- `.bottom-line`: removed from blame rendering in 9c6aeb4
- `.commit-status-link`: removed from templates in f3c4baa
- `.instruct-toggle`: removed from templates in 75e85c2
- `.runner-new-text`, `#runner-new`: never referenced outside CSS
- `.ap-terminal`: stale, asciinema-player uses `.ap-term`
- `.scrolling.dimmable.dimmed`: dimmer stand-in never adds this class
- `.markup span.align-center/align-right/float-left/float-right`: never
  produced by any renderer, sanitizer strips class attributes
- `.markup ul.no-list`, `.markup ol.no-list`: same as above

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 Apr 10, 2026
@silverwind silverwind added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 10, 2026
@silverwind silverwind requested a review from Copilot April 10, 2026 17:27
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 removes unused/dead CSS selectors from the web frontend stylesheets, reducing stylesheet size and avoiding maintenance of rules for classes/IDs that are no longer emitted by templates, Go code, or the JS/TS UI.

Changes:

  • Removed repo-related unused selectors (.instruct-toggle, .commit-status-link) from repo.css.
  • Removed unused modal dimmer selectors involving .scrolling.dimmable.dimmed from modules/modal.css.
  • Removed unused markup/asciicast selectors (e.g. .no-list, .align-*, .float-*, .ap-terminal) and legacy code/blame selectors (.archived-icon, .bottom-line) from the relevant CSS files.
  • Removed unused Actions runner selectors (.runner-new-text, #runner-new) from actions.css.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web_src/css/repo.css Drops unused repo/issue selectors that no longer appear in UI markup.
web_src/css/modules/modal.css Removes unused “dimmed” selector variants for scrolling dimmables.
web_src/css/markup/content.css Removes unused markup alignment/no-list selectors that aren’t produced/kept.
web_src/css/markup/asciicast.css Removes a stale asciicast terminal selector override.
web_src/css/base.css Removes unused archived/blame/bottom-line related selectors.
web_src/css/actions.css Removes unused runner “new” label selectors.

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

@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 Apr 10, 2026
Comment thread web_src/css/markup/asciicast.css
@wxiaoguang wxiaoguang marked this pull request as draft April 11, 2026 07:23
Upstream renamed the class from `.ap-terminal` to `.ap-term`. The
`overflow: hidden` fix from go-gitea#26159 is still needed, update the selector
and add a comment noting it may change across versions.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Comment thread web_src/css/markup/asciicast.css Outdated
Signed-off-by: silverwind <me@silverwind.io>
@silverwind silverwind marked this pull request as ready for review April 11, 2026 10:30
Comment thread web_src/css/markup/asciicast.css
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: silverwind <me@silverwind.io>
@silverwind
Copy link
Copy Markdown
Member Author

Claude re-verified all other removals, all dead.

@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 Apr 11, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor

Maybe need to backport the ap-term fix.

@wxiaoguang wxiaoguang added the backport/v1.26 This PR should be backported to Gitea 1.26 label Apr 11, 2026
@silverwind
Copy link
Copy Markdown
Member Author

Let's backport it completely, it's safe.

@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 11, 2026
@silverwind silverwind enabled auto-merge (squash) April 11, 2026 10:40
@silverwind silverwind merged commit d913fae into go-gitea:main Apr 11, 2026
26 checks passed
@silverwind silverwind deleted the remove-dead-css branch April 11, 2026 10:41
@GiteaBot GiteaBot added this to the 1.27.0 milestone Apr 11, 2026
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Apr 11, 2026
Remove CSS rules whose HTML classes/IDs are no longer referenced in any
template, Go source, or JavaScript/TypeScript file:

- `.archived-icon`: removed from templates in c85bb62
- `.bottom-line`: removed from blame rendering in 9c6aeb4
- `.commit-status-link`: removed from templates in f3c4baa
- `.instruct-toggle`: removed from templates in 75e85c2
- `.runner-new-text`, `#runner-new`: never referenced outside CSS
- `.ap-terminal`: stale, asciinema-player uses `.ap-term`, still not
needed
- `.scrolling.dimmable.dimmed`: dimmer stand-in never adds this class
- `.markup span.align-center/align-right/float-left/float-right`: never
produced by any renderer, sanitizer strips class attributes
- `.markup ul.no-list`, `.markup ol.no-list`: same as above

---
This PR was written with the help of Claude Opus 4.6

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Apr 11, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 11, 2026
silverwind added a commit that referenced this pull request Apr 11, 2026
Backport #37173 by @silverwind

Remove CSS rules whose HTML classes/IDs are no longer referenced in any
template, Go source, or JavaScript/TypeScript file:

- `.archived-icon`: removed from templates in c85bb62
- `.bottom-line`: removed from blame rendering in 9c6aeb4
- `.commit-status-link`: removed from templates in f3c4baa
- `.instruct-toggle`: removed from templates in 75e85c2
- `.runner-new-text`, `#runner-new`: never referenced outside CSS
- `.ap-terminal`: stale, asciinema-player uses `.ap-term`, still not
needed
- `.scrolling.dimmable.dimmed`: dimmer stand-in never adds this class
- `.markup span.align-center/align-right/float-left/float-right`: never
produced by any renderer, sanitizer strips class attributes
- `.markup ul.no-list`, `.markup ol.no-list`: same as above

---
This PR was written with the help of Claude Opus 4.6

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 14, 2026
* main:
  Add comment for the design of "user activity time" (go-gitea#37195)
  fix(api): handle missing base branch in PR commits API (go-gitea#37193)
  Refactor htmx and fetch-action related code (go-gitea#37186)
  Fix encoding for Matrix Webhooks (go-gitea#37190)
  Always show owner/repo name in compare page dropdowns (go-gitea#37172)
  fix(api): handle fork-only commits in compare API (go-gitea#37185)
  Improve Contributing docs and set a release schedule (go-gitea#37109)
  Update Nix flake (go-gitea#37183)
  Remove outdated RunUser logic (go-gitea#37180)
  Refactor flash message and remove SanitizeHTML template func (go-gitea#37179)
  Indicate form field readonly via background (go-gitea#37175)
  Remove dead CSS rules (go-gitea#37173)
  Fix flaky `TestCatFileBatch/QueryTerminated` test (go-gitea#37159)
  Implement logout redirection for reverse proxy auth setups (go-gitea#36085)
  Add missing `//nolint:depguard` (go-gitea#37162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/v1.26 This PR should be backported to Gitea 1.26 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants