public
Description: Makes uniform buttons and links that look like buttons easier
Clone URL: git://github.com/relevance/pretty_buttons.git
Search Repo:
pretty_buttons / README
100644 37 lines (27 sloc) 1.082 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
PrettyButtons
=============
 
 Based on the methods by Kevin Hale to create nice cross browser buttons.
 (see http://particletree.com/features/rediscovering-the-button-element)
 
<button type="submit" class="button positive">
  <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
</button>
 
<a class="button" href="/password/reset/">
  <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
</a>
 
<a href="#" class="button negative">
  <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
</a>
 
 
Example
=======
 
<p class="buttons">
  <%= pretty_positive_button "Create" %>
  <%= pretty_negative_button_link 'Cancel', posts_path %>
</p>
 
<p class="buttons">
  <%= pretty_button "Add Comment", "icons/comment.gif" %>
</p>
 
<p class="buttons">
  <%= pretty_button_link "Contact Us", contact_path, {:icon_path => "icons/contact.gif"} %>
</p>
 
Silk Icons from http://famfamfam.com/lab/icons/silk/, released under the Creative Commons Attribution 2.5 License
Copyright (c) 2008 Relevance, Inc., released under the MIT license