fix: simplify project link prefix icon styling

This commit is contained in:
EmberSparks 2026-05-29 17:37:33 +08:00
parent 4b0bf96a3c
commit abca906fab
3 changed files with 21 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

View file

@ -937,14 +937,10 @@
min-width: 1.35em;
height: 1.35em;
margin-top: 0.05em;
padding: 0 0.2em;
border-radius: 999px;
font-size: 0.92em;
font-weight: 700;
line-height: 1;
color: inherit;
background: var(--github-stars-project-link-prefix-bg);
box-shadow: var(--github-stars-project-link-prefix-shadow);
}
.github-stars-repo-project-link-label {

View file

@ -21,3 +21,24 @@ test('仓库卡片不应直接请求 external-link 作为自定义图标', () =>
'仓库卡片应使用插件私有图标 ID避免重复渲染'
);
});
test('项目链接前缀图标不应带背景色或阴影容器', () => {
const stylesSource = readFileSync(new URL('../styles.css', import.meta.url), 'utf8');
const projectLinkPrefixBlockMatch = stylesSource.match(
/\.github-stars-repo-project-link-prefix\s*\{[\s\S]*?\n\}/
);
assert.ok(projectLinkPrefixBlockMatch, '应存在 github-stars-repo-project-link-prefix 样式块');
const projectLinkPrefixBlock = projectLinkPrefixBlockMatch[0];
assert.doesNotMatch(
projectLinkPrefixBlock,
/\bbackground\s*:/,
'项目链接前缀图标不应再带背景色'
);
assert.doesNotMatch(
projectLinkPrefixBlock,
/\bbox-shadow\s*:/,
'项目链接前缀图标不应再带阴影'
);
});