diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-09-08 21:57:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 13:57:18 +0000 |
commit | ffa4949eaaf645995c5a20cd302d0256417b97ed (patch) | |
tree | 9457c20c4f3f54ca7c8d0b1760eefad8ab8666fa /web_src/css/shared | |
parent | 4807f7be22c2cf5ceffab241cec24058f1628125 (diff) | |
download | gitea-ffa4949eaaf645995c5a20cd302d0256417b97ed.tar.gz gitea-ffa4949eaaf645995c5a20cd302d0256417b97ed.zip |
Improve flex list UI (#26970)
1. There is already `gt-ac`, so no need to introduce `flex-item-center`
2. The `flex-item-baseline` and `.flex-item-icon svg { margin-top: 1px
}` seem to be a tricky patch, they don't resolve the root problem, and
still cause misalignment in some cases.
* The root problem is: the "icon" needs to align with the sibling
"title"
* So, make the "icon" and the "title" both have the same height
3. `flex-text-inline` could only be used if the element is really
"inline", otherwise its `vertical-align` would make the box size change.
In most cases, `flex-text-block` is good enough.
![image](https://github.com/go-gitea/gitea/assets/2114189/1b7acfc2-b1c7-4e9c-a983-2fa932026479)
---------
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src/css/shared')
-rw-r--r-- | web_src/css/shared/flex-list.css | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/web_src/css/shared/flex-list.css b/web_src/css/shared/flex-list.css index b9c22c4a0b..b5ae5cbd49 100644 --- a/web_src/css/shared/flex-list.css +++ b/web_src/css/shared/flex-list.css @@ -9,14 +9,6 @@ padding: 1em 0; } -.flex-item-baseline { - align-items: baseline; -} - -.flex-item-center { - align-items: center; -} - .flex-item .flex-item-leading { display: flex; align-items: flex-start; @@ -41,8 +33,10 @@ color: var(--color-primary) !important; } -.flex-item .flex-item-icon svg { - margin-top: 1px; +.flex-item .flex-item-icon { + display: flex; + align-items: center; + height: 20px; /* match the default flex-item-title height */ } .flex-item .flex-item-trailing { @@ -65,6 +59,7 @@ font-weight: var(--font-weight-semibold); word-break: break-word; min-width: 0; + min-height: 20px; } .flex-item .flex-item-title a { |