Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: extra element break menu style #663

Open
kagawagao opened this issue Jan 10, 2024 · 6 comments
Open

bug: extra element break menu style #663

kagawagao opened this issue Jan 10, 2024 · 6 comments
Assignees
Labels
Accepted This issue is accepted ⏹ Pending This issue is pending

Comments

@kagawagao
Copy link

kagawagao commented Jan 10, 2024

this element make child combinator(>) in menu style breaked

https://github.com/Tencent/tdesign-common/blob/50bcb279b7ced6dea5b0d359972156c7e7c00124/style/web/components/menu/_index.less#L278-L291

Copy link

👋 @kagawagao,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Copy link

github-actions bot commented Jan 10, 2024

♥️ 有劳 @timi137137 @liweijie0812 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @kagawagao

@kagawagao
Copy link
Author

sorry for not use issue template, this issue is create with code reference directly

@timi137137
Copy link
Collaborator

hummm,sorry,i don't quite understand what the question is, perhaps you can provide more information?

@timi137137 timi137137 added the Need More Info The problem is not clearly described label Jan 10, 2024
@kagawagao
Copy link
Author

MenuItem and SubMenu is wrapped by div in MenuContent component, this make css child combinator(>) selector not work.

For example

less styles in common

& > *:not(.@{prefix}-menu-group) {
        &:not(:first-child) {
          margin-top: @comp-margin-xs;
        }
      }

which compiled to css is

.t-default-menu__inner .t-menu>*:not(.t-menu-group):not(:first-child) {
  margin-top: var(--td-comp-margin-xs);
}

this css style make only .t-menu direct child elements has margin-top, but you guys add div element to wrap MenuItem and SubMenu, and then, css selector has been breaked, all MenuItem's margin-top property not been applied

@kagawagao
Copy link
Author

Menu in TDesign Site:

image

Menu in Starter:

image

@timi137137 timi137137 added ⏹ Pending This issue is pending Accepted This issue is accepted and removed Need More Info The problem is not clearly described labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted This issue is accepted ⏹ Pending This issue is pending
Projects
None yet
Development

No branches or pull requests

3 participants