This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
/
buttons.handlebars
137 lines (98 loc) · 3.62 KB
/
buttons.handlebars
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{{setTitle "Buttons"}}
{{setSubTitle "Simple CSS for buttons."}}
{{setActiveNav "buttons"}}
{{addRemoteCSS "https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css"}}
{{> header}}
<div class="content">
{{sectionHeading "Default Buttons"}}
<p>
To create a Pure Button, add the {{code "pure-button"}} classname to any {{code "<a>"}} or {{code "<button>"}} element.
</p>
{{#prefixIds "default"}}
{{> buttons/default}}
{{/prefixIds}}
{{#code}}
{{> buttons/default}}
{{/code}}
{{sectionHeading "Disabled Buttons"}}
<p>
To mark a button as disabled, add the {{code "pure-button-disabled"}} classname alongside {{code "pure-button"}}.
Alternatively, add the "disabled" attribute directly to your button.
</p>
{{#prefixIds "disabled"}}
{{> buttons/disabled}}
{{/prefixIds}}
{{#code}}
{{> buttons/disabled}}
{{/code}}
{{sectionHeading "Active Buttons"}}
<p>
To style a button so that it appears "pressed", add the {{code "pure-button-active"}} classname alongside {{code "pure-button"}}.
</p>
{{#prefixIds "active"}}
{{> buttons/active}}
{{/prefixIds}}
{{#code}}
{{> buttons/active}}
{{/code}}
{{sectionHeading "Primary Buttons"}}
<p>
To indicate that a button represents a primary action, add the {{code "pure-button-primary"}} classname alongside {{code "pure-button"}}.
</p>
{{#prefixIds "primary"}}
{{> buttons/primary}}
{{/prefixIds}}
{{#code}}
{{> buttons/primary}}
{{/code}}
{{sectionHeading "Customizing Buttons"}}
<p>
Thanks to Pure's minimal styling, it is easy to build off of the generic Pure button and create customized buttons for your own application.
</p>
<p>
To customize button styles, you should group your custom CSS into a class such as {{code "button-foo"}}, which you can then add to an element that already has the {{code "pure-button"}} classname. Here are some examples.
</p>
<h3 class="content-subhead">Colored buttons with rounded corners</h3>
{{#prefixIds "primary"}}
{{> buttons/colors}}
{{/prefixIds}}
{{#code}}
{{> buttons/colors}}
{{/code}}
<h3 class="content-subhead">Buttons with different sizes</h3>
{{#prefixIds "primary"}}
{{> buttons/sizes}}
{{/prefixIds}}
{{#code}}
{{> buttons/sizes}}
{{/code}}
<h3 class="content-subhead">Buttons with icons</h3>
<p>
Pure doesn't ship with icon fonts, but we play nice with existing ones. Incorporating icon fonts with Pure Buttons is easy. In the example below, we're using icon fonts from <a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a>. Put the <a href="http://fortawesome.github.io/Font-Awesome/get-started/">Font Awesome CSS file</a> on your page and use an {{code "<i>"}} element within a {{code "pure-button"}} element.
</p>
{{#prefixIds "primary"}}
{{> buttons/icons}}
{{/prefixIds}}
{{#code}}
{{> buttons/icons}}
{{/code}}
{{sectionHeading "Button Groups"}}
<p>
Group multiple buttons together on a single line.
</p>
<aside>
<p>
For assistive technologies (i.e, screen readers) a {{code "role"}} attribute should be provided to ensure that proper meaning is conveyed. Button groups should have a {{code "role=\"group\""}}, while toolbars should have {{code "role=\"toolbar\""}}.
</p>
<p>
Additionally, a clear label should be provided since most assistive technologies will not announce them. The code snippet below provides an example.
</p>
</aside>
{{#prefixIds "default"}}
{{> buttons/groups}}
{{/prefixIds}}
{{#code}}
{{> buttons/groups}}
{{/code}}
</div>
{{> prevent-scroll}}