nextui icon indicating copy to clipboard operation
nextui copied to clipboard

fix(theme): color discrepancy in select

Open macci001 opened this issue 1 year ago • 5 comments

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 Screenshot 2024-08-16 at 2 26 13 PM
  • Underline: When value is selected in SELECT component, color remains text-foreground-500. Label does not change the color according to the color variant. Screenshot 2024-08-16 at 2 25 59 PM
  • 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-foreground when value is selected. Screenshot 2024-08-16 at 2 23 52 PM
  • Underline: Color becomes text-default-foreground when value is selected. Label color changes according to the color variant. Screenshot 2024-08-16 at 2 23 52 PM
  • Flat: bg-color lightens on hover.
  • Faded: bg-color will darken on hover.

Select component after all changes

Screenshot 2024-08-22 at 1 38 44 PM

Changes are made to the value slot 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.

macci001 avatar Aug 16 '24 09:08 macci001

🦋 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

changeset-bot[bot] avatar Aug 16 '24 09:08 changeset-bot[bot]

@macci001 is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Aug 16 '24 09:08 vercel[bot]

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?

Share
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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to 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.

coderabbitai[bot] avatar Aug 16 '24 09:08 coderabbitai[bot]

@macci001 please DM me at discord (same username)

wingkwong avatar Aug 21 '24 08:08 wingkwong

@wingkwong applied the asked changes and updated the PR description.

macci001 avatar Aug 22 '24 08:08 macci001

  • 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.

recording

ghost avatar Sep 28 '24 04:09 ghost

@macci001 please take a look

wingkwong avatar Sep 28 '24 04:09 wingkwong