Skip to content

Button groups, toggle buttons and radio buttons#308

Closed
lvivier wants to merge 6 commits intotwbs:masterfrom
lvivier:radiotoggle
Closed

Button groups, toggle buttons and radio buttons#308
lvivier wants to merge 6 commits intotwbs:masterfrom
lvivier:radiotoggle

Conversation

@lvivier
Copy link
Copy Markdown

@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
Copy Markdown
Contributor

kasperp commented Sep 26, 2011

Very nice

@dator-zz
Copy link
Copy Markdown

i'm +1 ! Very nice job !

@dashed
Copy link
Copy Markdown

dashed commented Sep 26, 2011

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

@nunziofiore
Copy link
Copy Markdown

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

@olvlvl
Copy link
Copy Markdown
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
Copy Markdown

👍 looks nice!

@analytically
Copy link
Copy Markdown

Sexxxy!

@pearkes
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

batuhan commented Sep 27, 2011

perfect!

@necolas
Copy link
Copy Markdown
Contributor

necolas commented Sep 27, 2011

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

@mdo
Copy link
Copy Markdown
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
Copy Markdown
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.