gitea/web_src/css/repo/home-file-list.css
Kerwin Bryant 02e49a0f47 Fix vertical centering of file tree icons and use entryIcon for submodules/symlinks (#34137)
In the file tree, the icons are not vertically centered, which affects
the overall visual consistency.
Currently, the icons of submodules and symlinks do not adopt the value
of entryIcon, resulting in inconsistent icon display.

before:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_README md
(3)](https://github.com/user-attachments/assets/d521b89f-909a-43f9-8f39-787b0243b159)

after:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_README md
(2)](https://github.com/user-attachments/assets/4866807f-c890-4709-b595-7086011e5231)

---------

Co-authored-by: silverwind <me@silverwind.io>
2025-04-09 18:10:16 -07:00

95 lines
2.2 KiB
CSS

#repo-files-table {
width: 100%;
display: grid;
grid-template-columns: 2fr 3fr auto;
border: 1px solid var(--color-secondary);
background: var(--color-box-body);
border-radius: var(--border-radius);
margin: 10px 0; /* match the "clone-panel-popup" margin to avoid "visual double-border" */
}
@media (max-width: 767.98px) {
#repo-files-table {
grid-template-columns: auto 1fr auto;
}
}
#repo-files-table .repo-file-item {
display: contents;
}
#repo-files-table .repo-file-item:hover > .repo-file-cell,
#repo-files-table .parent-link:hover {
background: var(--color-hover-opaque);
}
#repo-files-table .repo-file-line,
#repo-files-table .repo-file-cell {
border-top: 1px solid var(--color-secondary);
padding: 8px 10px;
}
#repo-files-table .repo-file-line:first-child {
border-top: none;
border-radius: var(--border-radius) var(--border-radius) 0 0;
}
#repo-files-table .repo-file-item:last-child .repo-file-cell:first-child {
border-bottom-left-radius: calc(var(--border-radius) - 1px);
}
#repo-files-table .repo-file-item:last-child .repo-file-cell:last-child {
border-bottom-right-radius: calc(var(--border-radius) - 1px);
}
#repo-files-table .repo-file-line {
grid-column: 1 / span 3;
display: flex;
align-items: center;
gap: 0.5em;
}
#repo-files-table .repo-file-last-commit {
min-width: 0; /* otherwise the flex axis is not limited and the text might overflow in Pale Moon */
background: var(--color-box-header);
}
#repo-files-table .repo-file-cell.name {
display: flex;
align-items: center;
gap: 0.5em;
overflow: hidden;
}
#repo-files-table .repo-file-cell.name > a,
#repo-files-table .repo-file-cell.name > span {
flex-shrink: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#repo-files-table .repo-file-cell.name .entry-name {
flex-shrink: 1;
min-width: 3em;
}
@media (max-width: 767.98px) {
#repo-files-table .repo-file-cell.name {
max-width: 35vw;
}
}
#repo-files-table .repo-file-cell.message {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--color-text-light-1);
}
#repo-files-table .repo-file-cell.age {
text-align: right;
white-space: nowrap;
color: var(--color-text-light-1);
}