-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce flex-list
& flex-item
elements for Gitea UI
#25790
Conversation
06efb78
to
86d9c11
Compare
Is there a way to reduce the space above "yesterday" at the bottom? |
IIRC there is already a |
flex-card
& flex-list
elements for Gitea UIflex-list
& flex-item
elements for Gitea UI
Missed this one, will review soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't gotten time for testing it.
Some selectors are likely having unnecessary dependency, eg: .flex-list .branches .truncated-name
and flex-list .branches .branch
. Ideally, the "flex-list.css" is a independent layout framework, the "page" related selectors may need a totally new selector, eg: .xxx-branch-list .branch ...
.
But I can vote my LGTM, while I think some improvements could be done later.
@wxiaoguang Thanks for noticing, I moved the unrelated styles to the issue-list css file where they belong. |
I would like to wait for silverwind's opinion before merging, as this is a large refactoring. |
Looks good and I can't really spot any difference between the old issuelist, so let's give this a try. |
* upstream/main: Introduce `flex-list` & `flex-item` elements for Gitea UI (go-gitea#25790) Mention `devtest` in frontend contributing guidelines (go-gitea#26249)
<div role="main" aria-label="{{.Title}}" class="page-content organization members"> | ||
<div role="main" aria-label="{{.Title}}" class="page-content organization"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to delete this "members" class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any impact? of regression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe they were depending on this class for customization. I wonder if there would be a better way to indicate the current page to CSS, like an data attribute that indicates the matching template file or router. We could make better stability guarantees for those then these flimsy classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any impact? of regression
Although there is currently no impact. But there is no way to tell under Vanilla JS whether it is a "Members" page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JS, you could check the URL which I guess is more stable than these classes. e.g. check if /^\/[^/]+/[^/]+/members$/.test(window.location.pathname)
.
This PR introduces a new UI element type for Gitea called
flex-item
. It consists of a horizontal card with a leading, main and trailing part:The idea behind it is that in Gitea UI, we have many cases where we use this kind of layout, but it is achieved in many different ways:
.ui.list
with additional hacky flexbox.ui.key.list
- looks to me like a style set originally created for ssh/gpg key list, was used in many other places.issue.list
- created for issue cards, used in many other placesThis new style is based on
.issue.list
, specifically the refactoring of it done in #25750.In this PR, the new element is introduced and lots of templates are being refactored to use that style. This allows to remove a lot of page-specific css, makes many of the elements responsive or simply provides a cleaner/better-looking way to present information.
A devtest section with the new style is also available.
Screenshots (left: before, right: after)