bangumi / bangumi/server

[Feature Request]: 支持超合金组件

Open
#266 22 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
679
Forks
77
Avg merge
12m
Merged PRs (30d)
7

Description

虽然现在基本不可能考虑这个问题,但姑且发个 Issue。

### 你想添加的新功能

复刻超合金组件。做成类似主站现有的超合金组件就好。
但要是 CSS 能类似 Stylus 一样支持 `@-moz-document` 关键词以及类似 Tampermonkey 一样提供一些内置命令比如 `GM_addstyle` 的话就更好了。

### 你希望的解决方案

俺也不知道有什么解决方案,也许已经做出了超合金组件的 Sai 老板知道?

### 其他可能的替代方案

Tampermonkey 可以替代。但是有两个问题:
一是 Tampermonkey 无法跨浏览器共享用户数据,你在PC上使用的插件没法在手机浏览器上启用。
二是与账号无关,登出后仍然会生效。(尽管这样做也有好处。)

### 其他相关信息

希望新站点能让 DOM 解析更简洁!现在构建页面会通过 CSS Modules 处理,导致类名不再固定,这对经常需要解析页面元素的超合金组件实在是不友好。举例:[group 页面](https://sites--bangumi-next.netlify.app/group/sandbox) 中几乎所有元素都有了小尾巴。如果能想办法规避就好了。比如手动加上简单的类名(不考虑重名毕竟CSS不通过它渲染)或 ID,或者能提供前端 API 用于获取页面元素,之类的?

(补充说明:`小尾巴`指尾部会有一个 hash 值,比如 `_title_gvkfu_51` 中的 `_gvkfu_51`)

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Start by reviewing the existing main-site superalloy component and the group page example, then inspect how CSS Modules produces hashed class names. Done would require an agreed scope for component support, DOM access, and any CSS or Tampermonkey-compatible APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, stylus
Domain
api, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.