button 样式迁移

This commit is contained in:
lutinglt
2025-07-02 23:02:42 +08:00
parent 0c22591727
commit 3015ce8696
12 changed files with 568 additions and 372 deletions

View File

@@ -1,5 +1,4 @@
// organize-imports-ignore
// tslint:disable:ordered-imports
// 组件导入有顺序, 禁止插件优化
import "./actions";
import "./diff";
import "./issue";
import "./setting";

View File

@@ -0,0 +1,25 @@
import { css, themeVars } from "src/types/vars";
export const button = css`
.issue-content-left .field.footer {
// 关闭工单按钮
.ui.red.basic.button#status-button {
color: ${themeVars.github.fgColor.done};
background-color: ${themeVars.color.button};
border-color: ${themeVars.color.light.border};
&:hover {
background-color: ${themeVars.color.hover.self};
}
}
// 重新开启按钮
.ui.basic.primary.button#status-button {
color: ${themeVars.github.fgColor.success};
background-color: ${themeVars.color.button};
border-color: ${themeVars.color.light.border};
&:hover {
background-color: ${themeVars.color.hover.self};
}
}
}
`;

View File

@@ -0,0 +1,68 @@
import { css, themeVars } from "src/types/vars";
import { primaryHoverStyle, primaryStyle } from "styles/public/button";
const tinyStyle = {
color: themeVars.github.button.primary.fgColor.accent,
backgroundColor: themeVars.color.button,
borderColor: themeVars.color.light.border,
};
const tinyHoverStyle = {
color: themeVars.github.button.primary.fgColor.rest,
backgroundColor: themeVars.github.button.primary.bgColor.hover,
borderColor: themeVars.github.button.primary.borderColor.hover,
};
// 设置界面下的按钮
export const button = css`
// 不包含管理员的设置界面
.user-main-content,
.repo-setting-content,
.user-setting-content,
.org-setting-content {
// 主色调按钮替换为普通按钮
.ui.primary.button {
color: ${themeVars.color.text.light.self};
background-color: ${themeVars.color.button};
border-color: ${themeVars.color.light.border};
&:hover {
background-color: ${themeVars.color.hover.self};
}
}
// 迷你按钮替换为自定义的主色调按钮 (例: SSH 验证按钮)
.ui.primary.button.tiny {
${tinyStyle}
&:hover {
${tinyHoverStyle}
}
}
}
// 右上角迷你按钮替换会主色调按钮
.user-main-content,
.repo-setting-content,
.user-setting-content,
.org-setting-content,
.admin-setting-content {
.ui.attached.header > .ui.right {
.ui.primary.button.tiny {
${primaryStyle}
padding: 3px 12px;
min-height: 20px;
line-height: 20px;
&:hover {
${primaryHoverStyle}
}
}
}
}
// 管理员设置界面下的自定义主色调按钮
.admin-setting-content .ui.primary.button {
${tinyStyle}
padding: 5px 16px;
line-height: 22px;
&:hover {
${tinyHoverStyle}
}
}
`;