Skip to content

Move Fomantic dropdown CSS to custom module#36530

Merged
silverwind merged 18 commits intogo-gitea:mainfrom
silverwind:dropdowncss
Feb 27, 2026
Merged

Move Fomantic dropdown CSS to custom module#36530
silverwind merged 18 commits intogo-gitea:mainfrom
silverwind:dropdowncss

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Feb 3, 2026

Moved fomantic dropdown css to custom module, tested on the dropdown devtest page, it renders exactly the same as before while using roughly 50% less CSS. The clean up was very conservative, likely more can be done in the future.

Also, this fixes a bug present on main branch where dropdown border has incorrect color on hover.

Moved fomantic dropdown css to custom module, tested on the dropdown
devtest page, it renders exactly the same as before while using roughly
half the CSS. The clean up was very conservative, likely more can be
done in the future.

Also, this fixes a bug present on main branch where dropdown border has
incorrect color on hover.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 3, 2026
@silverwind silverwind added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Feb 3, 2026
lunny
lunny previously approved these changes Feb 6, 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 6, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor

image

@silverwind silverwind marked this pull request as draft February 10, 2026 07:09
silverwind and others added 2 commits February 12, 2026 18:28
* origin/main: (34 commits)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  Fix mirror sync parser and fix mirror messages (go-gitea#36504)
  Update JS and PY deps (go-gitea#36576)
  Add viewer controller for mermaid (zoom, drag) (go-gitea#36557)
  Misc typescript tweaks (go-gitea#36523)
  Use full-file highlighting for diff sections (go-gitea#36561)
  fix(diff): reprocess htmx content after loading more files (go-gitea#36568)
  [skip ci] Updated translations via Crowdin
  Add wrap to runner label list (go-gitea#36565)
  fix: add dnf5 command for Fedora in RPM package instructions (go-gitea#36527)
  Enable pagination on GiteaDownloader.getIssueReactions() (go-gitea#36549)
  Refactor merge conan and container auth preserve actions taskID (go-gitea#36560)
  Fix assignee sidebar links and empty placeholder after go-gitea#32465 refactor (go-gitea#36559)
  Fix various version parsing problems (go-gitea#36553)
  ...
Restore CSS rules from the original fomantic dropdown module that were
not carried over during the migration to a custom module. This fixes
image alignment in dropdown items (e.g. assignee filter avatars) and
restores rules for allowAdditions, empty selection state, and the
multi-select sizer span.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Feb 12, 2026

Fixed image-related regressions and checked various dropdowns on the page, couldn't see any more regressions.

@silverwind silverwind marked this pull request as ready for review February 12, 2026 17:53
@silverwind silverwind marked this pull request as draft February 13, 2026 04:47
…rule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 migrates Fomantic dropdown CSS from the Fomantic build system to a custom CSS module, reducing CSS size by approximately 50% through conservative cleanup. The migration involves removing the dropdown component from Fomantic's semantic.json configuration and creating a new custom dropdown.css module that replaces the Fomantic styles with Gitea's custom variables and conventions.

Changes:

  • Removed Fomantic dropdown component from build configuration and created custom dropdown.css module
  • Consolidated dropdown-related CSS rules from base.css and divider.css into the new module
  • Disabled stylelint rule preventing em units for line-height to accommodate migrated Fomantic code

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web_src/fomantic/semantic.json Removed "dropdown" from Fomantic components list
web_src/fomantic/build/fomantic.css Removed import of Fomantic dropdown.css
web_src/fomantic/build/components/dropdown.css Deleted entire Fomantic dropdown CSS file (1755 lines)
web_src/css/modules/dropdown.css Added new custom dropdown module (1041 lines) with Gitea-specific variables and styles
web_src/css/modules/divider.css Removed dropdown divider styles (moved to dropdown.css)
web_src/css/index.css Added import for new dropdown.css module
web_src/css/base.css Removed dropdown-related CSS rules (moved to dropdown.css)
stylelint.config.js Disabled declaration-property-unit-disallowed-list rule to allow em units for line-height

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

Signed-off-by: silverwind <me@silverwind.io>
@wxiaoguang wxiaoguang dismissed lunny’s stale review February 15, 2026 10:48

Suggested by lunny https://discord.com/channels/322538954119184384/323701541297192961/1472491165004726345

And we might could enable the feature that dissmissing all the previous reviews once a new commit pushed after it was approved or rejected.

This PR gets new changes after approval.

@GiteaBot GiteaBot added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 15, 2026
@silverwind
Copy link
Copy Markdown
Member Author

This comment was written by Claude.

I performed a visual verification of dropdown rendering on the dropdowncss branch against the expected behavior, testing both dark and light themes on a local dev server.

Dropdowns verified

Devtest page (/devtest/fomantic-dropdown):

  • Search-input dropdown with flex-items menu
  • Search dropdown (single selection)
  • Selection dropdown with items
  • Multiple selection dropdown with labels
  • Dropdown buttons (mini, tiny, button, compact sizes)

Header navigation:

  • "+" create menu (New Repository, New Migration, New Organization)
  • User avatar menu (Profile, Starred, Subscriptions, Settings, etc.)

Repository pages:

  • Branch selector dropdown
  • "Code" clone dropdown (HTTP/SSH/Tea CLI tabs, clone URL, IDE links, download links)
  • "Add File" dropdown

Issue creation:

  • Branch/Tag selector with search input and tabs

Settings pages:

  • HTTP Method selection dropdown (webhook settings)
  • Webhook type dropdown with images (Gitea, Gogs, Slack, Discord, DingTalk, Telegram, Microsoft Teams, Feishu, Matrix)

Footer:

  • Theme selector dropdown

Result

No visual regressions detected. All dropdowns render correctly in both themes — backgrounds, borders, shadows, hover/active states, icon alignment, text colors, and spacing all match expected behavior.

Copy link
Copy Markdown
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will checkout this branch soon, to look into devtools

@ChristopherHX ChristopherHX self-requested a review February 27, 2026 12:22
@silverwind silverwind marked this pull request as draft February 27, 2026 13:33
@silverwind
Copy link
Copy Markdown
Member Author

Looks like a merge has re-introduced some previously deleted CSS on this branch, I will fix.

silverwind and others added 4 commits February 27, 2026 15:58
* origin/main:
  feat: add branch_count to repository API (go-gitea#35351) (go-gitea#36743)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use octicon-triangle-down SVG instead of the Dropdown icon font for
selection dropdowns, and remove the now-unused @font-face and related
CSS rules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove CSS for features not used in the codebase: right/left floated
items, icon button dropdown, compact selection, .flag selector, loading
dropdown button, large dropdown font-size, top-left pointing dropdown,
pointing upward dropdown, and large button dropdown padding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silverwind silverwind marked this pull request as ready for review February 27, 2026 15:28
@silverwind
Copy link
Copy Markdown
Member Author

Ready again, removed a bunch more unused css.

@ChristopherHX
Copy link
Copy Markdown
Contributor

The diff looks much cleaner now, next trying to compare the dropdowns visually myself between this PR and main.

@silverwind
Copy link
Copy Markdown
Member Author

fyi some of these can be tested on http://localhost:3000/devtest/fomantic-dropdown. They should be nearly indistinguishable from main branch, even all the misalignments are preserved.

@ChristopherHX
Copy link
Copy Markdown
Contributor

They should be nearly indistinguishable from main branch, even all the misalignments are preserved.

Yes I confirm the devtest page looks and behave the same.

@silverwind
Copy link
Copy Markdown
Member Author

Then please approve and lets merge.

@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 27, 2026
@ChristopherHX
Copy link
Copy Markdown
Contributor

Was still looking outside of the test page, looks good.

@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
@silverwind silverwind enabled auto-merge (squash) February 27, 2026 16:43
@silverwind
Copy link
Copy Markdown
Member Author

Thanks!

@silverwind silverwind merged commit 50ec48d into go-gitea:main Feb 27, 2026
26 checks passed
@silverwind silverwind deleted the dropdowncss branch February 27, 2026 16:45
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 27, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 27, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 27, 2026
* origin/main:
  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)
  Lazy-load some Vue components, fix heatmap chunk loading on every page (go-gitea#36719)
  Filter out untracked files from spellchecking (go-gitea#36756)
  Fix CSS stacking context issue in actions log (go-gitea#36749)
  Fix milestone/project text overflow in issue sidebar (go-gitea#36741)
  Update tool dependencies and fix new lint issues (go-gitea#36702)
  Instance-wide (global) info banner and maintenance mode (go-gitea#36571)
  Add created_by filter to SearchIssues (go-gitea#36670)
  Inline and lazy-load EasyMDE CSS, fix border colors (go-gitea#36714)

# Conflicts:
#	templates/repo/issue/view_content/pull_merge_box.tmpl
#	web_src/js/features/repo-issue-pull.ts
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/frontend modifies/internal topic/code-linting 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.

6 participants