-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
topic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.type/refactoringExisting code has been cleaned up. There should be no new functionality.Existing code has been cleaned up. There should be no new functionality.
Description
The Problem
There are at least 5 different "hiding" methods in code:
- Fomantic-UI's
.hiddenclass - Browser and Fomantic-UI's
[hidden]attribute - Gitea's
.hideclass - Inline
style="display: none" - jQuery's
hide()(show/toggle)
Some of these mechanisms just conflict:
[hidden]is the weakest one, it will be affected bydisplay: xxx- Sometimes, it should use
display: none !importantto overwrite other style'sdisplay: block - Fomantic-UI's
.hiddenhas other definitions for different selectors - jQuery's
hide()may not work well with somedisplay: none !important
The Solution
- Introduce our own
.gt-hidden { display: none !important; }- the
!importantis necessary because there are alwaysblockorflexelements need to be hidden - done in Move helpers to be prefixed with
gt-#22879
- the
- Hijack jQuery's
hide()and related functions to use our.gt-hidden- Extend jQuery with customized show/hide/toggle #22884
- Update: replaced by our own showElem and related function, all-in-one step. Refactor hiding-methods, remove jQuery show/hide, remove
.hideclass, remove inline style=display:none #22950
- Drop all other classes/attributes, only use the
.gt-hiddento hide
FAQ
Why the gu- prefix? (Or something else like gt-, etc...)
- It means "Gitea UI", it's time to have our own frontend framework and have a global design, instead of patching everything again and again.
- It is a clear style, won't be polluted by Fomantic UI
- It makes the refactoring clear, every changed line could be reviewed to check whether something is affected.
- It makes it easier to be searched from whole code base, since it's a dedicated name.
- It's widely accepted to add prefixes for frameworks. For example, tailwind also supports prefix: https://tailwindcss.com/docs/configuration#prefix
Metadata
Metadata
Assignees
Labels
topic/uiChange the appearance of the Gitea UIChange the appearance of the Gitea UItype/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.type/refactoringExisting code has been cleaned up. There should be no new functionality.Existing code has been cleaned up. There should be no new functionality.