baidu / baidu/amis

css variables 考虑加上 --amis 前缀,解决单个页面加载多套组件库变量冲突样式错乱问题

Open
#6,451 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 是否关联于某个问题吗:
很多组件库都是默认使用 `--primary-color` 来命名 CSS 变量,导致加载多套组件库时会相互影响

#### 预期的解决方案:
有看到 ant-design 的解决方案是在 CSS variables 前面加了`--ant` 的前缀,如 `--ant-primary-color` ,参考 [ant-design css variables](https://github.com/ant-design/ant-design/blob/676a17038384df5607266db60597b00d7c4b5d86/scripts/css-variable-sync.js#L57)

Contributor guide

No contributing guide indexed for this repository

Research direction

No amis source file or test is named. Start by locating the CSS variable definitions and usages, then compare the referenced ant-design scripts/css-variable-sync.js approach. Done means variables are consistently prefixed so loading amis alongside another component library no longer causes cross-library style conflicts.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.