There have been a few articles recently about Google's new imageless buttons:
- http://stopdesign.com/archive/2009/02/04/recreating-the-button.html
- http://stopdesign.com/eg/buttons/3.0/code.html
- http://stopdesign.com/eg/buttons/3.1/code.html
- http://gmailblog.blogspot.com/2009/02/new-ways-to-label-with-move-to-and-auto.html
I really like how these new buttons work in Gmail. How can I use these or similar buttons on my site? Are there any open source projects with a similar look & feel?
If I wanted to roll my own button package like this using JQuery/XHTML/CSS, what elements could I use? My initial thoughts are:
-
Standard
<input type="button">
with css to improve the look (the design article talked mostly about the css/imges involves.) -
Jquery javascript to bring up a custom dialog rooted to the button on the "onclick" event which would have
<a>
tags in them and a search bar for filtering? Would a table layout for that popup be sane?
I'm terrible at reverse engineering things on the web, what are some of the tools that I could use to help reverse engineer these buttons? Using Firefox's web developer toolbar I can't really see the css or javascript (even if it is minified) that is used on the buttons popup dialogs. What browser tool or other method could I use to peek at them and get some ideas?
I'm not looking to steal any of Google's IP, just get an idea of how I could create similar button functionality.
Best Answer
-- EDIT -- I didn't see the link in the original post. Sorry! Will try and re-write to reflect actual question
StopDesign has an excellent post on this here. [edit 20091107] These were released as part of the closure library: see the button demo.
Basically the custom buttons he shows are created using a simple bit of CSS.
He originally used 9 tables to get the effect:![9 Tables](https://stopdesign.com/img/archive/2009/02/9-cell.png)
But later he used a simple 1px left and right margin on the top and bottom borders to achieve the same effect.
The gradient is faked by using three layers:![Button Gradient](https://stopdesign.com/img/archive/2009/02/bands-spec.png)
All of the code can be found at the Custom Buttons 3.1 page. (although the gradient without the image is only working in Firefox and Safari)
Step by Step Instructions
1 - Insert the following CSS:
2 - Use one of the following ways to call it (more can be found in the links above)
or