ant-design / ant-design/pro-components

🐛[BUG] Layout在嵌套的情况下,设置不同的token,样式会被覆盖

Open
#8,616 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🐛 bug 描述

复现地址:https://codesandbox.io/s/qian-tao-bu-ju-forked-sx7hjk?file=/App.tsx

Layout在嵌套的时候设置不同的token,最外层的Layout样式会被覆盖;通过demo可以看到Layout的样式没有携带hashid

### 📷 复现步骤

![image](https://github.com/user-attachments/assets/75c215d8-6bad-463e-b5d8-cba5e7623939)
![image](https://github.com/user-attachments/assets/dd028905-81cc-46a4-88c1-0debc3b7bf6d)

### 🏞 期望结果

希望样式可以不覆盖

### 💻 复现代码

参考复现demo

### © 版本信息

![image](https://github.com/user-attachments/assets/4a248bfa-48fb-48e2-aff4-39110c528d3c)

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and its App.tsx, focusing on nested Layout components that use different tokens. Confirm how the outer Layout styles lose their hashid and are overridden; done means the nested example preserves distinct styles without unintended overrides.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.