nextui
nextui copied to clipboard
fix(theme): color discrepancy in select
Closes #3659
📝 Description
The PR fixes the color of the selected value and label in SELECT component.
⛳️ Current behavior (updates)
- Bordered: When value is selected in SELECT component, color remains
text-foreground-500 - Underline: When value is selected in SELECT component, color remains
text-foreground-500. Label does not change the color according to thecolorvariant. - Flat: Currently the bg-color becomes darker on hover
- Faded: Hover does not have any effect on bg-color
🚀 New behavior
- Bordered: Color becomes
text-default-foregroundwhen value is selected. - Underline: Color becomes
text-default-foregroundwhen value is selected. Label color changes according to thecolorvariant. - Flat: bg-color lightens on hover.
- Faded: bg-color will darken on hover.
Select component after all changes
Changes are made to the
valueslot in Border and Underline variants.
Summary by CodeRabbit
Summary by CodeRabbit
-
New Features
- Enhanced styling for the select component to improve visual feedback based on the selection state.
- New color rule for the default state, adjusting text color when a value is present.
-
Bug Fixes
- Corrected the color of the selected value to align with design standards.
- Resolved label color issues in the underlined state for improved clarity.
🦋 Changeset detected
Latest commit: 90c1ec2a59992adcf4990963b6ecd77e1b200e1b
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @nextui-org/theme | Patch |
| @nextui-org/react | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@macci001 is attempting to deploy a commit to the NextUI Inc Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
The recent changes modify the styling of the select component to resolve font color inconsistencies in the bordered variant. A new style rule has been added to ensure the text color matches the presence of a selected value, thereby enhancing visual feedback for users. These updates aim to align the appearance of the select component with other input elements.
Changes
| Files | Change Summary |
|---|---|
.../select.ts |
Modified underlined state to change label to value with "group-data-[has-value=true]:text-default-foreground"; added new style rule for default state with the same value. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Consistent font color in select component (#3659) | ✅ | |
| Ensure font color reflects the selected state in bordered select | ✅ |
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
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 as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@macci001 please DM me at discord (same username)
@wingkwong applied the asked changes and updated the PR description.
- Flat: Currently the bg-color becomes darker on hover
I'm sorry, but I personally think there is an issue with this change, as it causes the Select component and the Input component to behave inconsistently.
@macci001 please take a look