0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-29 12:26:25 +01:00
gitea/web_src/css/repo/home.css

197 lines
3.6 KiB
CSS

.repo-grid-filelist-sidebar {
display: grid;
grid-template-columns: auto 280px;
grid-template-rows: auto auto 1fr;
gap: var(--page-spacing);
}
.repo-home-filelist {
min-width: 0;
grid-column: 1;
grid-row: 1 / 4;
}
.repo-home-sidebar-top {
grid-column: 2;
grid-row: 1;
}
.repo-home-sidebar-bottom {
grid-column: 2;
grid-row: 2;
}
.repo-home-sidebar-bottom .flex-list > :first-child {
border-top: 1px solid var(--color-secondary); /* same to .flex-list > .flex-item + .flex-item */
}
@media (max-width: 767.98px) {
.repo-grid-filelist-sidebar {
grid-template-columns: 100%;
grid-template-rows: auto auto auto;
}
.repo-home-filelist {
grid-column: 1;
grid-row: 2;
}
.repo-home-sidebar-top {
grid-column: 1;
grid-row: 1;
padding-left: 0;
}
.repo-home-sidebar-bottom {
grid-column: 1;
grid-row: 3;
padding-left: 0;
}
.repo-home-sidebar-bottom .flex-list > :first-child {
border-top: 0;
}
}
.repo-view-container {
display: flex;
gap: var(--page-spacing);
}
.repo-view-file-tree-container {
display: flex;
flex-direction: column;
flex: 0 0 15%;
min-width: 0;
max-height: 100vh;
position: sticky;
top: 0;
bottom: 0;
height: 100%;
overflow-y: hidden;
}
@media (max-width: 767.98px) {
.repo-view-file-tree-container {
display: none;
}
}
.repo-view-content {
flex: 1;
min-width: 0;
}
.language-stats {
display: flex;
gap: 2px;
padding: 0;
height: 10px;
white-space: nowrap;
border-radius: 5px;
overflow: hidden;
width: 100%;
margin-top: 1rem;
margin-bottom: 5px;
}
.language-stats-details {
display: flex;
flex-wrap: wrap;
}
.language-stats-details .item {
height: 30px;
display: flex;
align-items: center;
justify-content: center;
gap: 0.25em;
padding: 0 0.5em; /* make the UI look better for narrow (mobile) view */
text-decoration: none;
}
/* File view with TOC sidebar */
.file-view-container {
position: relative;
}
.file-view-container .file-view {
width: 100%;
}
/* TOC as a floating sidebar panel */
.file-view-toc {
position: fixed;
top: 60px;
right: 0;
width: 280px;
max-height: calc(100vh - 80px);
overflow-y: auto;
padding: 1rem;
background: var(--color-body);
border: 1px solid var(--color-secondary);
border-right: none;
border-radius: var(--border-radius) 0 0 var(--border-radius);
box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
z-index: 100;
transform: translateX(0);
transition: transform 0.25s ease-in-out;
}
/* Hidden state - using custom class to avoid Tailwind conflicts */
.file-view-toc.toc-panel-hidden {
transform: translateX(100%);
}
.file-view-toc details {
font-size: 13px;
}
.file-view-toc summary {
font-weight: var(--font-weight-semibold);
cursor: pointer;
padding: 8px 0;
color: var(--color-text);
border-bottom: 1px solid var(--color-secondary);
margin-bottom: 8px;
}
.file-view-toc ul {
margin: 0;
list-style: none;
padding: 5px 0 5px 1em;
}
.file-view-toc ul ul {
border-left: 1px dashed var(--color-secondary);
}
.file-view-toc a {
display: block;
padding: 6px 10px;
color: var(--color-text);
text-decoration: none;
font-size: 13px;
line-height: 1.4;
border-radius: var(--border-radius);
}
.file-view-toc a:hover {
color: var(--color-primary);
background: var(--color-hover);
}
/* TOC toggle button active state - when TOC is visible */
#toggle-toc-btn.active {
color: var(--color-primary);
background: var(--color-hover);
}
/* Hide TOC sidebar on small screens */
@media (max-width: 768px) {
.file-view-toc {
width: 100%;
max-width: 300px;
}
#toggle-toc-btn {
display: none;
}
}