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

Having multiple versions of react-dates on same page with different styles #2198

Open
oriooctopus opened this issue May 18, 2022 · 4 comments
Labels

Comments

@oriooctopus
Copy link

I have two separate date pickers on the same page, and I need to target each with different custom styles. As written in the docs, the only way to add custom styles is via global styles and not scoped local styles. That might still be ok, but it doesn't seem like there's any way to add a special classname to the datepicker, which would allow me to have the global styles target each specific usage.

So my question is, if I have to use global styles and I can't add a custom class name, how can I have multiple datepickers with different styles on the same page?

@ljharb
Copy link
Member

ljharb commented May 18, 2022

Add a unique class name to a container element around each datepicker, and target them that way.

@oriooctopus
Copy link
Author

@ljharb the issue with this is that wouldn't affect the actual popup, it would only affect the original input. The popup is rendered I guess via a portal and is not a descendant of the original parent
Screen Shot 2022-05-18 at 5 10 28 PM

@ljharb
Copy link
Member

ljharb commented May 18, 2022

That is a fair point.

@ljharb ljharb reopened this May 18, 2022
@oriooctopus
Copy link
Author

@ljharb I'm glad you agree :) Do you think it's possible to add a wrapper class prop for the popup?

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

No branches or pull requests

2 participants