From 8c5020fa09cadd49bb72591e06342ddb5ab733aa Mon Sep 17 00:00:00 2001 From: lutinglt Date: Wed, 6 Aug 2025 11:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=8E=A2=E7=B4=A2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BB=93=E5=BA=93=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.md | 1 + README.md | 12 +++---- styles/components/explore.ts | 69 ++++++++++++++++++++++++++++++++++++ styles/components/index.ts | 1 + styles/components/repo.ts | 4 +-- 5 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 styles/components/explore.ts diff --git a/.github/release.md b/.github/release.md index 18759e9..6cb77e6 100644 --- a/.github/release.md +++ b/.github/release.md @@ -4,3 +4,4 @@ - 同步 Issue/PR 的评论样式 - 同步表情菜单样式 +- 同步探索页面仓库样式 diff --git a/README.md b/README.md index 14dcb03..cd79f0c 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,13 @@ THEMES = gitea-dark, github-dark } ``` ->[!IMPORTANT] +> [!IMPORTANT] > ->请确保在 `:root` 选择器中添加自定义变量,否则无法生效 +> 请确保在 `:root` 选择器中添加自定义变量,否则无法生效 > ->变量之间用 `;` 分隔 +> 变量之间用 `;` 分隔 > ->建议自定义变量放在单独的文件中, 通过 shell 命令等方式追加到主题文件中 +> 建议自定义变量放在单独的文件中, 通过 shell 命令等方式追加到主题文件中 ### CSS 变量 @@ -74,7 +74,3 @@ THEMES = gitea-dark, github-dark ## 贡献 欢迎提交 Issue 或 Pull Request - -``` - -``` diff --git a/styles/components/explore.ts b/styles/components/explore.ts new file mode 100644 index 0000000..f03381c --- /dev/null +++ b/styles/components/explore.ts @@ -0,0 +1,69 @@ +import { css, otherThemeVars, themeVars } from "src/types/vars"; + +// 仓库列表 +export const repositoriesExplore = css` + // 组织 + /* .page-content.organization.profile > .ui.container > .ui.stackable > .ui.eleven, */ + // 用户 + /* .page-content.user.profile > .ui.container > .ui.stackable > .ui.twelve, */ + // 探索 + .page-content.explore.repositories > .ui.container { + > .flex-list { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 16px; + + > .flex-item { + border: 1px solid ${themeVars.color.light.border}; + border-radius: ${otherThemeVars.border.radius}; + padding: 16px; + // 仓库头像 + > .flex-item-leading { + img, + svg { + color: ${themeVars.color.text.light.num1}; + } + } + // 仓库信息 + > .flex-item-main { + // 仓库标题 + > .flex-item-header { + // 仓库名称 + > .flex-item-title { + gap: 8px; + // 仓库中间的间隔线 + &:not(a) { + color: ${themeVars.color.text.light.num1}; + } + // 仓库类型和状态标签 + > .label-list .label { + padding: 3px 6px; + } + } + // 仓库语言, 星标 + > .flex-item-trailing { + color: ${themeVars.color.text.light.num1}; + gap: 16px; + font-size: 12px; + > .flex-text-inline .tw-mr-2 { + margin-right: 0 !important; + } + } + } + // 描述和更新时间 + > .flex-item-body { + margin-top: 8px; + // 更新时间 + &:last-child { + font-size: 12px; + } + } + // 主题标签 + > .label-list { + margin-top: 8px; + } + } + } + } + } +`; diff --git a/styles/components/index.ts b/styles/components/index.ts index 4c5d1ed..098982c 100644 --- a/styles/components/index.ts +++ b/styles/components/index.ts @@ -3,6 +3,7 @@ import "./clone"; import "./commit"; import "./dashboard"; import "./diff"; +import "./explore"; import "./filelist"; import "./heatmap"; import "./issue"; diff --git a/styles/components/repo.ts b/styles/components/repo.ts index 1874cd5..b5048bf 100644 --- a/styles/components/repo.ts +++ b/styles/components/repo.ts @@ -74,13 +74,13 @@ export const repoMenu = css` export const repoTopic = css` // 理应只能覆盖探索/组织/用户下仓库的 topic 标签 - .label-list .ui.label, + // 避免渲染到仓库的类型标签 + .flex-item-main > .label-list .ui.label, // 仓库文件列表下的 topic 标签 #repo-topics .ui.label.repo-topic { border-radius: 25px; font-size: 12px; padding: 5px 10px; - margin: 0px 1.5px 3.5px 0px; background-color: ${themeVars.github.bgColor.accent.muted}; color: ${themeVars.github.fgColor.accent}; &:hover {