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

Button groups, toggle buttons and radio buttons #308

Closed
wants to merge 6 commits into from
Closed

Button groups, toggle buttons and radio buttons #308

wants to merge 6 commits into from

Conversation

lvivier
Copy link

@lvivier lvivier commented Sep 26, 2011

I've added toggles and radio buttons as in issue #81. There's a fiddle to play with, and they look like this:

Radios & Toggles

  • The attached buttons are called "button groups". In the OS X interface guidelines they're called "segmented controls"; jQuery UI calls them "button sets". Suggestions?
  • These rely on some Javascript, and it's the first time I've ever written unit test cases (!) so maintainers should scrutinize those probably.

@kasperp
Copy link
Contributor

kasperp commented Sep 26, 2011

Very nice

@dator-zz
Copy link

i'm +1 ! Very nice job !

@dashed
Copy link

dashed commented Sep 26, 2011

I really like this! Though, the toggle animation seems un-natural in Chrome 15 beta.

@nunziofiore
Copy link

+1, i d like to see it on bootstrap too

@olvlvl
Copy link
Contributor

olvlvl commented Sep 27, 2011

That's nice, but I'd rather have labels with inputs in them, so that I can actually retrieve the values when I post my forms. Here is an update to your fiddle :

http://jsfiddle.net/olvlvl/tjVbC/

In my opinion a ".radio" class should for a single element, not a group of elements. That's why I renamed the class ".radio" to ".radio-group".

PS: On the JS part I did what I could with my limited knowledge of jQuery, you see I'm a MooTools guy :)

@goshacmd
Copy link

👍 looks nice!

@analytically
Copy link

Sexxxy!

@pearkes
Copy link

pearkes commented Sep 27, 2011

@olvlv The text can be too easily selected on press. Looks kind of ugly. Some sort of onselect fix?

@lvivier
Copy link
Author

lvivier commented Sep 27, 2011

@olvlvl Great—in my case I didn't want to send the values to the server, but this is ideal. I'll update the pull request shortly.

@pearkes We can use

-moz-user-select: none;
-webkit-user-select: none;
user-select: none;

on the label and it should be all good.

@batuhan
Copy link

batuhan commented Sep 27, 2011

perfect!

@necolas
Copy link
Contributor

necolas commented Sep 27, 2011

Looks a bit like what I did here - https://github.com/necolas/css3-facebook-buttons

@mdo
Copy link
Member

mdo commented Sep 29, 2011

Awesome work :).

Since this can't be merged automagically, I took a stab at just coding this from your fiddle example. Haven't added the radio or checked options yet, just built it using anchors. It merges some of your markup and that of @necolas to start.

Check it out in the 2.0-wip branch and let me know what you think.

@lvivier
Copy link
Author

lvivier commented Sep 29, 2011

Right on! That looks great. Clearly I have lots to learn about LESS.

Since the basics are in now, I'll close this request and work from 2.0-wip from now on.

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

Successfully merging this pull request may close these issues.