-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix(link-menu): fix link-menu theme vars #2246
Conversation
WalkthroughThe changes involve renaming CSS variables in the Changes
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
packages/theme/src/link-menu/vars.less (1)
13-43
: Summary of changes and recommendationThe changes in this file consistently improve the naming conventions for the link menu component's CSS variables. The mixin and all custom properties have been renamed to follow a more modern and readable format.
While these changes enhance the code quality and maintainability, they constitute a breaking change that will affect existing implementations using the old variable names.
Recommendation:
- Ensure these breaking changes are clearly communicated in the changelog and release notes.
- Consider providing a migration guide for users to update their code to the new variable names.
- If possible, implement a deprecation strategy that supports both old and new variable names for one release cycle before fully removing the old names.
These steps will help users smoothly transition to the new naming convention while maintaining their existing implementations.
packages/theme/src/link-menu/index.less (4)
55-57
: LGTM! Consider using variables for consistency.The explicit padding for the dialog box header improves clarity. The added empty line enhances readability by separating different sections of the styles.
Consider using CSS variables for the padding values to maintain consistency and ease future updates:
- padding: 32px 32px 16px; + padding: var(--tv-LinkMenu-dialog-header-padding, 32px 32px 16px);
89-91
: LGTM! Comprehensive button styling update.The CSS variable names for button properties have been consistently updated to the new
--tv-LinkMenu-*
convention. This improves the overall structure and maintainability of the component's styling.Consider using CSS variables for the width and height of the button to improve flexibility:
- width: 32px; - height: 32px; + width: var(--tv-LinkMenu-btn-width, 32px); + height: var(--tv-LinkMenu-btn-height, 32px);Also applies to: 93-94
136-138
: LGTM! Consistent tree node styling update.The CSS variable names for tree node properties have been updated to follow the new
--tv-LinkMenu-*
convention. This change improves consistency across the component's styling.Consider using a dedicated variable for the tree node font size instead of reusing the input font size:
- font-size: var(--tv-LinkMenu-input-font-size); + font-size: var(--tv-LinkMenu-tree-node-font-size, var(--tv-LinkMenu-input-font-size));This allows for more flexibility in styling tree nodes independently from input elements.
145-145
: LGTM! Consider a dedicated variable for focusable nodes.The text color variable for focusable tree nodes has been updated to use the new naming convention, which is good for consistency.
However, using the input text color for focusable tree nodes might not provide the best visual distinction. Consider introducing a dedicated variable for focusable node text color:
- color: var(--tv-LinkMenu-input-text-color); + color: var(--tv-LinkMenu-tree-node-focusable-text-color, var(--tv-LinkMenu-input-text-color));This allows for more flexibility in styling focusable nodes independently from input elements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- packages/theme/src/link-menu/index.less (6 hunks)
- packages/theme/src/link-menu/vars.less (1 hunks)
🧰 Additional context used
🔇 Additional comments (10)
packages/theme/src/link-menu/vars.less (3)
13-13
: Improved mixin naming conventionThe renaming of the mixin from
.component-css-vars-link-menu()
to.inject-LinkMenu-vars()
is a positive change. It follows a more consistent naming convention using PascalCase for "LinkMenu" and the term "inject" more accurately describes the mixin's purpose. This improvement enhances clarity and maintainability.
15-43
: Consistent application of naming changesThe renaming of CSS custom properties has been applied consistently throughout the file. All variables have been updated to the new naming convention, and no variables appear to have been missed. The comments above each variable remain unchanged and continue to provide clear explanations of each variable's purpose.
This consistency is commendable and will help maintain the code's readability and maintainability.
15-43
: Consistent renaming of CSS custom propertiesThe renaming of all CSS custom properties from
--tv-Link-menu-*
to--tv-LinkMenu-*
is a positive change. It introduces a more consistent naming convention using PascalCase for "LinkMenu", which aligns with modern CSS practices and improves readability.However, it's important to note that this is a breaking change. Any existing code that relies on the old variable names will need to be updated.
To assess the impact of this change, please run the following script to find any usage of the old variable names in the codebase:
✅ Verification successful
All usages of old CSS custom properties have been updated
The search for any remaining usage of the old CSS custom properties did not yield any results. This confirms that the renaming from
--tv-Link-menu-*
to--tv-LinkMenu-*
has been successfully implemented throughout the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining usage of the old CSS variable names rg --type=less --type=vue --type=js --type=ts '\-\-tv\-Link\-menu\-'Length of output: 98
Script:
#!/bin/bash # Add 'vue' as a recognized file type and search for any remaining usage of the old CSS variable names rg --type-add 'vue:*.vue' --type=less --type=vue --type=js --type=ts '\-\-tv\-Link\-menu\-'Length of output: 93
packages/theme/src/link-menu/index.less (7)
29-31
: LGTM! Consistent variable renaming.The CSS variable names have been updated to follow the new
--tv-LinkMenu-*
convention. This change maintains consistency and improves the overall structure of the component's styling.
43-43
: LGTM! Consistent styling for text and icons.The SVG fill color now uses the same variable as the text color (
--tv-LinkMenu-nav-item-text-color
). This ensures visual consistency between text and icons in the navigation items.
72-73
: LGTM! Consistent variable renaming for navigation styling.The CSS variable names for text and background colors have been updated to follow the new
--tv-LinkMenu-*
convention. This change maintains consistency in the component's styling and improves readability.
103-109
: LGTM! Comprehensive input styling update.The CSS variable names for input properties have been consistently updated to the new
--tv-LinkMenu-*
convention. This change covers all essential aspects of input styling, including dimensions, typography, colors, and shape. The update improves the overall consistency and maintainability of the component's styling.
173-174
: LGTM! Consistent icon sizing.The CSS variable names for icon width and height have been updated to follow the new
--tv-LinkMenu-*
convention. Using the same variable for both dimensions ensures square icons, which is typically desirable for consistency.
Line range hint
1-186
: Overall, excellent work on updating the link-menu styling!The changes consistently apply the new
--tv-LinkMenu-*
naming convention for CSS variables throughout the file. This improves the overall consistency and maintainability of the component's styling. The updates cover various aspects of the link-menu, including navigation items, buttons, inputs, and tree nodes.A few minor suggestions were made to further enhance flexibility and consistency:
- Consider using variables for dialog box padding.
- Introduce variables for button width and height.
- Use a dedicated variable for tree node font size.
- Create a separate variable for focusable tree node text color.
These suggestions are optional refinements to an already solid update. Great job on improving the link-menu theme variables!
26-26
: LGTM! Verify mixin definition.The change from
.component-css-vars-link-menu()
to.inject-LinkMenu-vars()
is consistent with the overall renaming pattern. This improves naming consistency across the component.Please ensure that the mixin definition has been updated accordingly in the
vars.less
file or wherever it is defined.✅ Verification successful
Mixin definition verified successfully.
The
.inject-LinkMenu-vars()
mixin is correctly defined invars.less
and properly invoked inindex.less
. No further action required.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the mixin definition rg --type less "inject-LinkMenu-vars" packages/theme/src/link-menu/Length of output: 199
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Bug Fixes