-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: Break long menu items into multiple lines #7665
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
overflow-wrap: break-word; | ||
line-height: normal; | ||
} | ||
|
||
.sidebar-container { | ||
position: relative; | ||
display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code you provided seems mostly clean and clear. However, here's a concise feedback with suggestions:
Code Changes and Suggestions
1. Adding class
to Sidebar Menu
- Description: You've added a class
custom-menu
to the sidebar menu, which is good for styling specific components easily.
<el-submenu v-for="(menuItem, index) in routerMenus" :key="`sub${index}`" style="margin-left: 24px;"
:show-timeout="300"
:hide-timeout="300"
:active-name="'submenu' + (activeIndex === index ? ' active' : '')"
:background-color="#fff"
text-align="center"
ref="submenusRef"
show-icon
- popper-class="popper-dropdown"
+ popper-class="popper-dropdown custom-popup-style"
:collapse-transition="false"
:unique-opened="true"
@select="handleMenuClick"
+ class="custom-menu"
>
Suggestion: Added additional styles related to truncation and line-height inside .custom-menu .el-menu-item
.
.custom-popup-style {
white-space: normal !important;
word-break: break-word;
overflow-wrap: break-word;
line-height: normal !important;
}
2. Styling Suggestion
- Problem: The default styling of the
.elm-menu-item
can often lead to truncated content. It might be more appropriate to allow items to wrap rather than truncate them.
.el-menu-item {
/* ... existing styles ... */
}
.custom-menu .el-menu-item {
word-break: break-all; /* To allow long lines to wrap instead of being cut off */
}
Summary
Overall, the changes are straightforward and maintain the functionality of the menu component. Adding a class specifically for the menu item is useful for customization purposes. Additionally, allowing line breaks in menu items could improve readability when dealing with longer texts.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wanghe-fit2cloud The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.