Files
gitea-themes/styles/components/repo/repo_files.ts
T
chuan 434161de5b
Release / release (push) Failing after 13s
Refactor theme management and update documentation
- Removed `.github-theme` from .gitignore as it is no longer needed.
- Updated `official-style-map.md` to clarify the maintenance of GitHub Light style increments within the current repository.
- Revised `rules.md` to reflect the new approach to maintaining GitHub Light theme increments.
- Changed test script in `package.json` to verify generated theme instead of GitHub migration.
- Added `verify-generated-theme.ts` script to validate the generated theme files.
- Migrated various styles from `.github-theme` to the new structure, updating comments and references accordingly.
2026-05-18 01:26:17 +08:00

225 lines
5.6 KiB
TypeScript

export const branchButton = `
.page-content.repository.file.list {
.ui.dropdown.branch-selector-dropdown > .menu > .menu {
/* 显示默认分支的标签 */
.ui.label {
background-color: var(--color-menu);
border: 1px solid var(--color-light-border);
margin-top: 1px;
margin-left: auto;
margin-right: 20px; /* gitea 有 RSS 留出足够的空间 */
}
}
}
`;
export const syncFork = `
.page-content.repository.file.list {
.repo-home-filelist > .ui.message {
background: var(--color-box-header);
padding: 8px 8px 8px 16px;
margin: 16px 0px;
.ui.button {
min-width: 96px;
}
}
}
`;
export const fileSearch = `
.file-search-popup.file-search-popup.file-search-popup {
animation: overlayAppearDown 200ms cubic-bezier(0.33, 1, 0.68, 1);;
/* 统一所有下拉菜单的样式 */
background-color: var(--color-menu);
border: unset;
border-radius: 12px;
box-shadow: var(--github-shadow-floating-small);
z-index: 2; /* 避免文件内容浏览界面中的固定导航栏遮挡 */
.file-search-results {
padding: 12px;
.item {
border-bottom: none;
border-radius: var(--border-radius);
padding: 6px 8px;
margin: 0 4px;
color: var(--color-text-light-1);
&.selected {
background-color: unset;
box-shadow: 0 0 0 2px var(--github-borderColor-accent-emphasis);
}
&:hover {
background: var(--github-control-transparent-bgColor-hover) !important;
}
.full-path :nth-child(2n) {
color: var(--color-text);
}
}
}
}
`;
export const repoFiles = `
/* 文件列表和提交列表的按钮组 */
.repo-button-row {
margin: 16px 0;
.repo-button-row-right {
/* 转到文件搜索框 */
.repo-file-search-container .ui.input {
min-height: 32px;
height: 32px;
> input {
background: unset;
}
}
/* 添加文件按钮 */
.repo-add-file {
padding: 0px 26px 0px 12px;
.menu > .item {
min-width: 128px;
svg {
margin-top: 0;
margin-right: 4px !important;
}
}
}
/* 克隆按钮 */
.ui.primary.button.js-btn-clone-panel {
padding: 0px 12px;
}
}
}
.repository.file.list {
#repo-files-table {
margin: 16px 0;
/* 头部最后一次提交 */
.repo-file-line {
padding-right: 16px;
/* 父目录 */
&.parent-link {
gap: 0.5rem;
padding-left: 16px;
svg {
margin-right: 2px;
}
}
/* 最后一次提交 */
&.repo-file-last-commit {
min-height: 3.725rem;
.latest-commit {
gap: 8px;
.commit-summary {
color: var(--color-text-light-1);
}
img.ui.avatar {
border-radius: 9999px;
margin-left: 2px;
width: 20px;
height: 20px;
}
/* 作者 */
.author-wrapper {
display: flex;
&:hover {
color: var(--color-text);
}
}
/* 提交哈希值 */
.ui.label {
display: none;
}
}
relative-time {
color: var(--color-text-light-1);
}
}
}
/* 文件列表 */
.repo-file-item {
.repo-file-cell {
height: 40px;
&.name {
display: flex;
align-items: center;
gap: 0.5rem;
padding-left: 16px;
}
&.age {
padding-right: 16px;
}
}
}
}
#readme {
.file-header {
background: var(--color-body);
min-height: 48px;
padding: 0px 8px !important;
overflow-x: visible;
svg {
color: var(--color-text-light-1);
}
.file-header-left {
padding: 6px 8px !important;
line-height: 1.45;
/* 伪元素宽度等于按钮宽度而不是父元素宽度 */
position: relative;
&:hover {
background: var(--github-control-transparent-bgColor-hover);
border-radius: var(--border-radius);
}
&:after {
content: "";
background: var(--github-underlineNav-borderColor-active);
border-radius: var(--border-radius);
bottom: -8px;
left: 0;
height: 2px;
position: absolute;
width: 100%;
}
a.muted:hover {
color: inherit;
text-decoration-line: none;
}
}
.file-header-right {
.btn-octicon {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0px 8px;
border-radius: var(--border-radius);
height: 28px;
width: 28px;
&:hover {
background: var(--github-control-transparent-bgColor-hover);
}
}
}
}
}
}
`;
export const repoFilesMobile = `
@media (max-width: 767.98px) {
#repo-files-table {
grid-template-columns: 1fr auto;
.repo-file-line {
grid-column: 1 / span 2;
}
.repo-file-cell {
&.name {
max-width: none;
}
&.message {
display: none;
}
}
}
}
`;
export const stylesheet = [branchButton, syncFork, fileSearch, repoFiles, repoFilesMobile].join("\n\n");