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

Allow styling using other units #81

Open
joshdotblack opened this issue Aug 9, 2020 · 4 comments
Open

Allow styling using other units #81

joshdotblack opened this issue Aug 9, 2020 · 4 comments

Comments

@joshdotblack
Copy link

We're trying to use react-switch in one of our projects & we've hit a bit of a snag with scaling the switch. Most of our layout & sizing is done with rem units, which we change at different breakpoints to let us do responsive design, but react-switch only allows us to set the width/height in px values. Is supporting other units on the roadmap?

@lmend22
Copy link

lmend22 commented Dec 1, 2020

Having the same issue is there any way to set width/height with CSS?

@markusenglund
Copy link
Owner

Since these props are used to calculate the handle position internally I don't it would be possible to let the library user specify height="10em" for example. One idea would be to have a separate prop called lengthUnit where the user could specify "em", "rem" or whatever. Is that something people would like?

@markusenglund
Copy link
Owner

@lmend22 See issue #63

@Rafaellarsa
Copy link

Since these props are used to calculate the handle position internally I don't it would be possible to let the library user specify height="10em" for example. One idea would be to have a separate prop called lengthUnit where the user could specify "em", "rem" or whatever. Is that something people would like?

Yes, that would be very useful!

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

4 participants