Skip to content

refactor: replace legacy tw-flex utility classes with flex-text-block/inline#36778

Merged
silverwind merged 1 commit intogo-gitea:mainfrom
xiaox315:refactor/replace-tw-flex-with-flex-text-classes
Feb 28, 2026
Merged

refactor: replace legacy tw-flex utility classes with flex-text-block/inline#36778
silverwind merged 1 commit intogo-gitea:mainfrom
xiaox315:refactor/replace-tw-flex-with-flex-text-classes

Conversation

@xiaox315
Copy link
Copy Markdown
Contributor

Summary

Replace combinations of tw-flex tw-items-center (with optional tw-gap-*) with semantic flex-text-block or flex-text-inline classes across 15 template files.

This follows the refactoring direction outlined in #35015 ("Refactor legacy tw-flex tw-items-center tw-gap-xx to flex-text-block or flex-text-inline").

Changes

Replacement rules applied:

  • tw-flex tw-items-center tw-gap-2flex-text-block (both have gap: 0.5rem)
  • tw-flex tw-items-center tw-gap-1flex-text-inline (both have gap: 0.25rem)
  • tw-flex tw-items-center (no explicit gap) → flex-text-block where the element is block-level and children benefit from the default gap
  • tw-flex tw-items-center (inline context, e.g. <a>, <span>) → flex-text-inline

Files modified (15):

  • templates/admin/config.tmpl — config page dt elements
  • templates/admin/repo/unadopted.tmpl — unadopted repo list items
  • templates/base/head_navbar.tmpl — active stopwatch popup
  • templates/org/header.tmpl — org header action buttons
  • templates/org/home.tmpl — member/team count links
  • templates/org/settings/labels.tmpl — labels page header
  • templates/repo/branch/list.tmpl — branch list header
  • templates/repo/commits_table.tmpl — commits table header
  • templates/repo/diff/box.tmpl — diff detail box
  • templates/repo/diff/new_review.tmpl — review form header
  • templates/repo/issue/card.tmpl — issue card unpin button
  • templates/repo/issue/view_content/attachments.tmpl — attachment file size
  • templates/repo/migrate/migrate.tmpl — migration service cards
  • templates/shared/user/org_profile_avatar.tmpl — org profile header
  • templates/webhook/new.tmpl — webhook type dropdown text

What was NOT changed:

  • Elements with tw-justify-between or tw-justify-center (these need additional classes)
  • Elements whose children use explicit margins (tw-mr-*, tw-ml-*) that would conflict with the gap from flex-text classes
  • Fomantic UI form elements with special layout requirements

Notes

  • This PR was created with AI assistance (Claude). All changes were reviewed individually to ensure semantic correctness and zero unintended visual changes.
  • No functional changes — purely CSS class refactoring.

Closes: part of #35015

…/inline

Replace combinations of `tw-flex tw-items-center` (and `tw-gap-*`)
with semantic `flex-text-block` or `flex-text-inline` classes across
15 template files.

- `tw-flex tw-items-center tw-gap-2` → `flex-text-block` (gap: 0.5rem)
- `tw-flex tw-items-center tw-gap-1` → `flex-text-inline` (gap: 0.25rem)
- `tw-flex tw-items-center` (no gap) → `flex-text-block` where appropriate

This follows the refactoring direction outlined in go-gitea#35015.

Ref: go-gitea#35015
Signed-off-by: xiaox315 <xiaox315@users.noreply.github.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 28, 2026
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Feb 28, 2026
@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 Feb 28, 2026
@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 Feb 28, 2026
@silverwind silverwind merged commit 3b250ba into go-gitea:main Feb 28, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 28, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 2, 2026
* giteaofficial/main: (21 commits)
  Enable docker layer caching for `dry-run` and `nightly` container builds (go-gitea#36738)
  Add admin badge to navbar avatar (go-gitea#36790)
  WorkflowDispatch api optionally return runid (go-gitea#36706)
  upgrade minimatch (go-gitea#36760)
  Add `never` option to `PUBLIC_URL_DETECTION` configuration (go-gitea#36785)
  Refactor avatar package, support default avatar fallback (go-gitea#36788)
  Mark unused&immature activitypub as "not implemented" (go-gitea#36789)
  Add “Copy Source” to markup comment menu (go-gitea#36726)
  Update Nix flake (go-gitea#36787)
  Implements OIDC RP-Initiated Logout (go-gitea#36724)
  Fix README symlink resolution in subdirectories like .github (go-gitea#36775)
  [skip ci] Updated translations via Crowdin
  Correct spelling (go-gitea#36783)
  refactor: replace legacy tw-flex utility classes with flex-text-block/inline (go-gitea#36778)
  Fix `no-content` message not rendering after comment edit (go-gitea#36733)
  Fix typos and grammar in English locale (go-gitea#36751)
  Move Fomantic dropdown CSS to custom module (go-gitea#36530)
  Use "Enable Gravatar" but not "Disable" (go-gitea#36771)
  feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743)
  Deprecate RenderWithErr (go-gitea#36769)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/templates This PR modifies the template files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants