-
Notifications
You must be signed in to change notification settings - Fork 310
feat(cascader): [cascader,tree] dark theme adaptation #3136
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
Conversation
WalkthroughThe changes update CSS styling across various components. The Cascader and Cascader Node components now use updated hover background colors, refined border definitions, and adjusted icon sizes and colors. New CSS variables are introduced, and existing ones are updated or renamed. The Transfer and Tree components also receive styling enhancements, including active state backgrounds and SVG adjustments. Vue demo examples reflect corresponding color updates. No modifications were made to the exported public APIs. Changes
Possibly related PRs
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/cascader/filterable.vueOops! 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. examples/sites/demos/pc/app/cascader/filterable-composition-api.vueOops! 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. Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
🔇 Additional comments (1)
🪧 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 pull request introduces dark theme adaptations for the cascader, transfer, and tree components. It addresses issues with selected background colors in the transfer box and custom height panel styles in the cascader. Changes
|
@@ -99,7 +102,10 @@ | |||
white-space: nowrap; | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
|
|||
svg { | |||
font-size: var(--tv-CascaderNode-icon-font-size); |
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.
Ensure that the SVG styles are compatible with all supported browsers, especially older versions that might not fully support CSS variables.
@@ -153,7 +153,9 @@ | |||
text-align: left; | |||
padding-right: var(--tv-Transfer-panel-body-padding-right); | |||
padding-left: var(--tv-Transfer-panel-body-padding-left); | |||
|
|||
.tiny-table.simple table tbody tr:has(td svg.is-check) { | |||
background-color: var(--tv-Transfer-panel-item-active-bg-color); |
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.
Check compatibility of the ':has()' pseudo-class as it may not be supported in all browsers. Consider using an alternative approach for broader compatibility.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
examples/sites/demos/pc/app/tree/icons-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/tree/icons.vue
(1 hunks)packages/vue/src/transfer/__tests__/transfer.test.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- examples/sites/demos/pc/app/tree/icons.vue
- examples/sites/demos/pc/app/tree/icons-composition-api.vue
🧰 Additional context used
🪛 GitHub Check: PR Unit Test
packages/vue/src/transfer/__tests__/transfer.test.tsx
[failure] 120-120:
ReferenceError: nextTick is not defined
❯ ../../packages/vue/src/transfer/tests/transfer.test.tsx:120:5
🪛 GitHub Actions: Unit Test PR--feat(cascader): [cascader,transfer,tree] dark theme adaptation
packages/vue/src/transfer/__tests__/transfer.test.tsx
[error] 120-120: FAIL PC Mode > left change event: ReferenceError: nextTick is not defined
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 (2)
packages/theme/src/cascader-node/vars.less (1)
29-29
: Consistent Variable Rename for Icon Size
The variable has been renamed from--tv-CascaderNode-icon-font-size
to--tv-CascaderNode-icon-size
, which clarifies that it controls icon dimensions rather than text font size. Ensure that all references in related files (for example, inindex.less
if applicable) are updated to maintain consistency across the project.packages/theme/src/tree/index.less (1)
363-367
: Enhanced SVG Styling in Tree Component
The adjustments applied to the direct child SVG elements of the tree node content—setting thefill
,font-size
, andmargin-right
via CSS variables—improve precise control over the icons in the dark theme context. Please verify that the variable--tv-Tree-node-operate-icon-font-size
is defined appropriately in your theme variables and is conceptually distinct from the cascader icons’ sizing (now using--tv-CascaderNode-icon-size
). Consistency in naming conventions across similar components helps prevent confusion in future maintenance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
examples/sites/demos/pc/app/transfer/custom-render-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/transfer/custom-render.vue
(1 hunks)packages/theme/src/cascader-node/index.less
(4 hunks)packages/theme/src/cascader-node/vars.less
(1 hunks)packages/theme/src/tree/index.less
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- examples/sites/demos/pc/app/transfer/custom-render-composition-api.vue
- examples/sites/demos/pc/app/transfer/custom-render.vue
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/theme/src/cascader-node/index.less
PR
PR Checklist
feat(cascader): [cascader,transfer,tree] dark theme adaptation
解决穿梭框选中背景色,级联选择自定义高度面板样式
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