baidu / baidu/amis

className样式被上层css样式覆盖

Open
#4,233 0 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

button按钮的className样式被上层css样式覆盖导致不生效,是否有类似css中“!”的写法提高class的优先级?

{
"type": "button",
"level": "primary",
"label": "提交"
},
{
"type": "button",
"level": "danger",
"className": "ml-40", //不生效
"label": "退出"
}

#### 截图或视频:

![捕获](https://user-images.githubusercontent.com/273961/167105992-0287f41d-f4d9-4578-a0ae-8f98299d3794.PNG)

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
`sdk`

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
sdk 1.8

4. 粘贴有问题的完整 `amis schema` 代码:
```
code here...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the SDK button schema shown, using the `className` value `ml-40` and the reported amis SDK 1.8 environment. No source file or test is identified in the report; done means the button's custom class styling remains effective when an upper-level CSS rule also applies.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.