-
Notifications
You must be signed in to change notification settings - Fork 276
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(input): [input] fix input disabled border style #2341
Conversation
WalkthroughThe changes in this pull request involve updates to the styling of the textarea component, specifically focusing on the disabled state and hover effects. The border color for the disabled textarea has been modified to use a new CSS variable, Changes
Possibly related PRs
Suggested reviewers
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 (2)
packages/theme/src/textarea/vars.less (1)
38-39
: LGTM! Consider adding a comment about usage.The addition of
--tv-Textarea-disabled-border-color
is appropriate and follows the existing naming and value assignment conventions. This variable will allow for more precise control over the disabled textarea's appearance, aligning with the PR's objective.Consider adding a brief comment about where this variable is used (e.g., in the component's main less file) to improve maintainability:
// 文本域disabled时的边框颜色 - --tv-Textarea-disabled-border-color: var(--tv-color-border-disabled); + --tv-Textarea-disabled-border-color: var(--tv-color-border-disabled); // Used in textarea/index.less for disabled statepackages/theme/src/textarea/index.less (1)
75-75
: Consistent styling for disabled textarea on hover.The change to use
var(--tv-Textarea-disabled-border-color)
for the hover state of a disabled textarea ensures visual consistency and prevents unintended changes on hover. This is a good improvement for user experience.For even better consistency, consider removing the hover effect entirely for disabled textareas:
&.is-disabled { background-color: var(--tv-Textarea-disabled-bg-color); &:before { background-color: var(--tv-Textarea-disabled-bg-color); } &:after { background-color: var(--tv-Textarea-disabled-bg-color); } - &:hover { - border-color: var(--tv-Textarea-disabled-border-color); - } }This would ensure that there's no visual change at all when hovering over a disabled textarea, which is typically the expected behavior for disabled elements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- packages/theme/src/textarea/index.less (2 hunks)
- packages/theme/src/textarea/vars.less (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/theme/src/textarea/index.less (2)
57-57
: Improved visual distinction for disabled textarea.The change from
var(--tv-Textarea-border-color)
tovar(--tv-Textarea-disabled-border-color)
enhances the visual feedback for disabled textareas. This improves accessibility and user experience by providing a clear visual cue for the disabled state.
Line range hint
1-324
: Summary of changes and their impactThe changes in this file focus on improving the visual distinction of disabled textareas by introducing a specific CSS variable for the disabled border color. This enhancement:
- Improves accessibility and user experience by providing clear visual feedback for disabled states.
- Maintains consistency across different states (normal and hover) of the disabled textarea.
- Utilizes CSS variables, allowing for easy theming and maintenance.
These changes align well with the PR objectives and contribute to a more robust and user-friendly textarea component.
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
Style