Skip to content
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

Cannot edit input field border colour in Datepicker #1519

Closed
jeremiahtam opened this issue Dec 23, 2024 · 3 comments
Closed

Cannot edit input field border colour in Datepicker #1519

jeremiahtam opened this issue Dec 23, 2024 · 3 comments

Comments

@jeremiahtam
Copy link

The Datepicker component does not have a theme access to modify the input field. There is no props or theme access to the input field itself. So it becomes impossible to change the cyan border color when in focus.

@akmalnatha
Copy link

Have you solved this issue? I'm currently facing the same problem.

@headi
Copy link

headi commented Jan 24, 2025

According to the respective component, that can be found here, you should be able to customize it with something like this:

<Datepicker theme={{
      root: {
        input: {
          field: {
            input: {
              colors: {
                gray: "border-gray-300 bg-gray-50 text-gray-900 focus:border-red-500 focus:ring-red-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-red-500 dark:focus:ring-red-500",
              },
            },
          }
        }
      }
    }}/>

(notice: I swapped cyan-500 for red-500
So Datepicker component will put what is inside root.input to the TextInput component theme which in turn is looking for field.input.colos[color] with the default color being gray.
If you want to know what the theme looks like, go here

@jeremiahtam
Copy link
Author

<Datepicker theme={{
root: {
input: {
field: {
input: {
colors: {
gray: "border-gray-300 bg-gray-50 text-gray-900 focus:border-red-500 focus:ring-red-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-red-500 dark:focus:ring-red-500",
},
},
}
}
}
}}/>

This seem to work fine. Thanks.
I don't know why its not part of the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants