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

Feature request: would love to have different sized switches. #24

Closed
faoiseamh opened this issue Feb 28, 2014 · 6 comments
Closed

Feature request: would love to have different sized switches. #24

faoiseamh opened this issue Feb 28, 2014 · 6 comments

Comments

@faoiseamh
Copy link

These switches are great, but they'd be even better with a small version to fit into smaller UI areas. I will build this if I have some more time down the road, but logging for now in case anyone else wants to sooner.

@tkh44
Copy link

tkh44 commented Mar 14, 2014

You can do something like this in your css:

.small + .switchery {
   height: 15px;
   width: 25px;
}

.small + .switchery > small {
   height: 15px;
   width: 15px;
}

Then just add the class "small" to your input like this:

You could of course change the class name to whatever you want and the sizes as well. I just did half the size in this example.

@abpetkov
Copy link
Owner

@faoiseamh, as @tkh44 noted, sizes are manageable by CSS only. I intentionally didn't include any size manipulations of the switch element by JavaScript, so that it could be easier for people that use it, to change it's size and overall look. The main CSS file 'switchery.css` is only default style, you are free to play around with it and do whatever you like with your switches, including making them smaller, as you want in your case.

@faoiseamh
Copy link
Author

Great, thanks guys. I didn't look into doing at the time, but I totally agree with keeping styling in CSS.

@gsans
Copy link

gsans commented May 30, 2014

Why not include different predefined sizes then like bootstrap?

@alimovz
Copy link

alimovz commented Jun 27, 2015

.small + .switchery {
height: 15px;
width: 25px;
}

.small + .switchery > small {
height: 15px;
width: 15px;
}

That's pretty slick. Thanks tkh44.

@abpetkov
Copy link
Owner

@gsans @alimovz Predefined sizes are released since 0.7.0.

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

5 participants