Skip to content

[Proposal] Refactor frontend hide/hidden mechanism #22847

Closed
@wxiaoguang

Description

@wxiaoguang

The Problem

There are at least 5 different "hiding" methods in code:

  • Fomantic-UI's .hidden class
  • Browser and Fomantic-UI's [hidden] attribute
  • Gitea's .hide class
  • Inline style="display: none"
  • jQuery's hide() (show/toggle)

Some of these mechanisms just conflict:

  • [hidden] is the weakest one, it will be affected by display: xxx
  • Sometimes, it should use display: none !important to overwrite other style's display: block
  • Fomantic-UI's .hidden has other definitions for different selectors
  • jQuery's hide() may not work well with some display: none !important

The Solution

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

No one assigned

    Labels

    topic/uiChange the appearance of the Gitea UItype/proposalThe 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions