-
Notifications
You must be signed in to change notification settings - Fork 284
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(cascader): [cascader,tooltip] cascader selection drop-down panel dark theme adaptation #2970
Conversation
… dark theme adaptation
WalkthroughThis pull request updates the styling in several Vue and Less files. In two tooltip components, the hover background color for the Changes
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
examples/sites/demos/pc/app/tooltip/theme.spec.jsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. ✨ Finishing Touches
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 (
|
WalkthroughThis PR introduces a dark theme adaptation for the cascader selection drop-down panel and tooltip demo. It modifies the background colors to ensure compatibility with both dark and light themes. Changes
|
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
🧹 Nitpick comments (1)
packages/theme/src/cascader/index.less (1)
119-121
: Dark Theme Dropdown Background UpdateUpdating the background property for the cascader menu to use the theme variable
var(--tv-Cascader-dropdown-bg-color)
instead of a fixed color is a good move for dark mode compatibility.
Suggestion: For stylistic consistency, consider adding a space after the colon (i.e.,background: var(--tv-Cascader-dropdown-bg-color);
).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
examples/sites/demos/pc/app/tooltip/control-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/tooltip/control.vue
(1 hunks)packages/theme/src/cascader/index.less
(2 hunks)packages/vue/src/cascader/src/pc.vue
(0 hunks)
💤 Files with no reviewable changes (1)
- packages/vue/src/cascader/src/pc.vue
✅ Files skipped from review due to trivial changes (2)
- examples/sites/demos/pc/app/tooltip/control.vue
- examples/sites/demos/pc/app/tooltip/control-composition-api.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (2)
packages/theme/src/cascader/index.less (2)
17-19
: Dynamic CSS Variable Prefix AssignmentThe use of the
~
operator to dynamically assign prefix class names (e.g.,@{css-prefix}cascader
) is an excellent approach. This increases maintainability and ensures that theme-specific adjustments propagate consistently across components.
312-314
: Search Input Background ThemingChanging the search input’s background to
var(--tv-Input-bg-color)
aligns the component styling with the overall theme adaptation strategy and improves dark theme support.
Minor note: Verify that the spacing and formatting conform to the project's style guidelines.
… dark theme adaptation
… dark theme adaptation
… dark theme adaptation
… dark theme adaptation
… dark theme adaptation
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
🧹 Nitpick comments (1)
packages/theme/src/cascader-menu/vars.less (1)
17-17
: Dynamic Theming for CascaderMenu Border ColorChanging the border color from a fixed value to
var(--tv-color-border-divider)
is an excellent approach for dynamic theming and dark mode compatibility. This update makes the component's styling cohesive with the global theme settings. One minor suggestion is to consider adding a fallback value (e.g.,var(--tv-color-border-divider, #f5f5f5)
) to ensure consistent appearance in environments where the variable might not be defined.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/demos/pc/app/tooltip/theme.spec.js
(1 hunks)packages/theme/src/cascader-menu/vars.less
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (3)
examples/sites/demos/pc/app/tooltip/theme.spec.js (3)
8-9
: Improved test robustness with more specific button selectionThe change to locate buttons within the
.box
container improves test reliability by ensuring the correct buttons are targeted, which is especially important for theme testing where multiple similar buttons might exist on the page.
12-12
: Consistent selector approach maintains test coherenceThis change follows the same pattern as the previous one, using the parent container to locate the Light-themed button, ensuring consistent selector strategy throughout the theme-related test cases.
15-28
:❓ Verification inconclusive
Verify if remaining button selectors need similar updates
The remaining button selectors (normal, warning, error, info, success) are still accessed directly from the page object, while Dark and Light buttons now use the tooltipBtn locator. Consider whether these should also use the same locator pattern for consistency.
🏁 Script executed:
#!/bin/bash # Check if other theme buttons also exist outside the .box container # which would justify why they don't need the same locator approach echo "Checking the tooltip theme demo structure..." cat $(fd -t f "theme.vue" --full-path examples/sites/demos/pc/app/tooltip) || echo "Theme demo file not found" # Also check the HTML structure to understand button organization rg -A 5 -B 5 "<button.*Dark" examples/sites/demos/pc/app/tooltip/Length of output: 1610
Consistency in Button Selector Locators
The dark and light tooltip tests already use the dedicated
tooltipBtn
locator, but the normal, warning, error, info, and success buttons are still accessed directly viapage.getByRole('button', …)
. Please verify whether these selectors should also be updated to use the same locator pattern for better consistency. If there’s a specific reason to treat these buttons differently, please document the deviation.
… dark theme adaptation
PR
feat(cascader): [cascader,tooltip] cascader selection drop-down panel dark theme adaptation
解决级联选择下拉面板背景色暗黑主题适配
解决tooltip demo自设置样式在黑白主题下的适配
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
.ellipsis
class for improved tooltip visibility.Cascader
component to reflect updated class names.