-
Notifications
You must be signed in to change notification settings - Fork 20
/
metro-buttons.html
452 lines (398 loc) · 22.1 KB
/
metro-buttons.html
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Metro buttons · Twittstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="a responsive web template built with twitter bootstrap, using LESS CSS and managed through github">
<meta name="author" content="twittstrap.com">
<!-- Le styles -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="assets/ico/favicon.png">
<!-- Google analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41573898-1', 'twittstrap.com');
ga('send', 'pageview');
</script>
</head>
<body data-spy="scroll" data-target=".bs-docs-sidebar">
<!-- Navbar
================================================== -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="./index.html">Twittstrap</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="">
<a href="./index.html">Home</a>
</li>
<li class="">
<a href="./getting-started.html">Get started</a>
</li>
<li class="">
<a href="./scaffolding.html">Scaffolding</a>
</li>
<li class="">
<a href="./base-css.html">Base CSS</a>
</li>
<li class="">
<a href="./font-awesome-example.html">Font awesome</a>
</li>
<li class="">
<a href="./font-awesome-icons.html">Icons</a>
</li>
<li class="active">
<a href="./metro-buttons.html">Metro buttons</a>
</li>
<li class="">
<a href="./components.html">Components</a>
</li>
<li class="">
<a href="./javascript.html">JavaScript</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Subhead
================================================== -->
<header class="jumbotron subhead" id="overview">
<div class="container">
<h1>CSS 3 Microsoft Metro buttons period :)</h1>
<p class="lead">Twittstrap includes metro buttons for the folks around the <i class="icon-globe icon-5x"></i>.</p>
</div>
</header>
<div class="container">
<div class="row">
<div class="span12">
<section>
<div class="page-header"><h2>Button Classes</h2></div>
<h3>Buttons</h3>
<p>
To create a modern-styled button, just add <code>class="m-btn"</code> to
any <code><a></code>, <code><button></code>, or
<code><input></code> html element. Viola! You now have a basic modern-styled button.
</p>
<div class="example">
<form>
<a class="m-btn">New Comment (link)</a>
<input class="m-btn" type="submit" value="New Comment (submit)" />
<button class="m-btn">New Comment (button)</button>
</form>
</div>
<pre class="code prettyprint"><code><form>
<a href="#" class="m-btn">Post comment</a>
<input class="m-btn" type="submit" value="New Comment (submit)" />
<button class="m-btn">New Comment (button)</button>
</form></code></pre>
</section>
<section>
<h3>Colored Buttons</h3>
<p>
To get some color to your buttons, you can do this by adding the
<code>blue</code>, <code>red</code>, <code>purple</code>, <code>black</code> or <code>green</code> class to your button.
</p>
<div class="example">
<a href="#button" class="m-btn blue">Color Blue</a>
<a href="#button" class="m-btn red">Color Red</a>
<a href="#button" class="m-btn purple">Color Purple</a>
<a href="#button" class="m-btn green">Color Green</a>
<a href="#button" class="m-btn black">Color Black</a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn red">Color Red</a></code></pre>
</section>
<section>
<h3>Striped buttons</h3>
<p>
If you prefer the buttons having "color highlights" instead of filling it up with one color, you can
use the <code>{color}-stripe</code> class. You'll get some stripes on the buttons like those being used at Microsoft's
Windows Azure website. Just use any of the <code>blue</code>, <code>red</code>, <code>purple</code> or <code>green</code> color classes above and put <code>-stripe</code> next to it. Examples can
be seen below.
</p>
<div class="example">
<a class="m-btn red-stripe">Red stripe</a>
<a class="m-btn purple-stripe">Purple Stripe</a>
</div>
<pre class="code prettyprint"><code><a href="#" class="m-btn red-stripe">Red Stripe</a>
<a href="#" class="m-btn purple-stripe">Purple stripe</a></code></pre>
</section>
<section>
<h3>Disabled Buttons</h3>
<p>
To depict a disabled button, it needs to look like it's unusable.
Add the <code>disabled</code> class for displaying a disabled button. Special note: This style automatically appears
when you use the <code>disabled</code> attribute in the element, no need to class it within the class attribute.
Same goes for the <code>active</code> classes.
</p>
<div class="example">
<a href="#button" class="m-btn disabled">Preview</a>
<a href="#button" class="m-btn" disabled>Preview</a>
<a href="#button" class="m-btn red disabled">Delete</i></a>
<a href="#button" class="m-btn red" disabled>Delete</i></a>
<a href="#button" class="m-btn black" disabled>Delete</i></a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn disabled">Preview</a>
<a href="#" class="m-btn" disabled>Preview</a>
<a href="#" class="m-btn red disabled">Delete</a>
<a href="#" class="m-btn red" disabled>Delete</a></code></pre>
</section>
<section>
<h3>Button sizes</h3>
<p>
You can also get the buttons in different sizes. Use the
<code>sm</code> class to shrink the text in buttons. To shrink the button itself
along with the size of the text, use the <code>mini</code> class. Lastly, there's the <code>big</code> class for
those tile-like buttons.
</p>
<div class="example">
<a href="#button" class="m-btn mini">Mini size</a>
<a href="#button" class="m-btn sm">Default size</a>
<a href="#button" class="m-btn big">Large size</a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn mini">Mini size</a>
<a href="#" class="m-btn sm">Default size</a>
<a href="#" class="m-btn big">Large size</a></code></pre>
<p>You can also mix and match the color classes and the size classes. Here are some examples:</p>
<div class="example">
<a href="#button" class="m-btn mini red">Delete</a>
<a href="#button" class="m-btn blue">Submit Entry</a>
<a href="#button" class="m-btn big purple">See pricing options</a>
</div>
</section>
<section>
<h3>Button groups</h3>
<p>
To group together a handful of buttons, just wrap them in an element that has
the <code>m-btn-group</code> class.
</p>
<div class="example">
<div class="m-btn-group">
<a href="#button" class="m-btn">Left</a>
<a href="#button" class="m-btn">Center</a>
<a href="#button" class="m-btn">Right</a>
</div>
</div>
<pre class="prettyprint"><code><div class="m-btn-group">
<a href="#" class="m-btn">Left</a>
<a href="#" class="m-btn">Center</a>
<a href="#" class="m-btn">Right</a>
</div></code></pre>
</section>
<section>
<h3>Button strips</h3>
<p>
Creating a sequence of button groups resembling a loosely coupled toolbar can be achieved
with the class <code>m-btn-strip</code>. It wraps all the button groups in a horizontal
manner to resemble a strip of buttons.
</p>
<div class="example">
<div class="m-btn-strip">
<a href="#button" class="m-btn">Compose New</a>
<div class="m-btn-group">
<a href="#button" class="m-btn">Archive</a>
<a href="#button" class="m-btn">Spam</a>
<a href="#button" class="m-btn">Delete</a>
</div>
<div class="m-btn-group">
<a href="#button" class="m-btn">Move to</a>
<a href="#button" class="m-btn">Labels</a>
</div>
<a href="#button" class="m-btn">More</a>
</div>
</div>
<pre class="prettyprint"><code><div class="<b>m-btn-strip</b>">
<a href="#" class="m-btn">Compose New</a>
<div class="m-btn-group">
<a href="#" class="m-btn">Archive</a>
<a href="#" class="m-btn">Spam</a>
<a href="#" class="m-btn">Delete</a>
</div>
<div class="m-btn-group">
<a href="#" class="m-btn">Move to</a>
<a href="#" class="m-btn">Labels</a>
</div>
<a href="#" class="m-btn">More</a>
</div></code></pre>
</section>
<section>
<div class="page-header"><h2>Icon Components</h2></div>
<h3>Icon classes</h3>
<p>
The icons that you can use for the buttons are also taken from the glyphicons image sprite used by Twitter Bootstrap.
<a href="http://twitter.github.com/bootstrap/base-css.html#icons">Twitter Bootstrap</a> has a great array of documents
for the complete list of icons in the glyphicon sprite, their respective CSS class names and how to use those icon classes.
</p>
<p>
I've also provided those "Swap Arrows" in one sprite. These are the arrows extensively being used by Microsoft.
Thanks to Syncfusion and their awesome Metro Studio.
</p>
<p>
<strong>Note:</strong> if the icons does not seem to appear, double check the filepath in the css files. The default folder path for the
icons is <code>../img/</code>
</p>
<div class="example">
<table>
<thead>
<tr>
<th scope="col">Class</th>
<th scope="col">Icon</th>
</tr>
</thead>
<tr>
<td scope="row"><code>.m-icon-swapright</code></td>
<td><i class="m-icon-swapright"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-swapleft</code></td>
<td><i class="m-icon-swapleft"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-swapup</code></td>
<td><i class="m-icon-swapup"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-swapdown</code></td>
<td><i class="m-icon-swapdown"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-big-swapright</code></td>
<td><i class="m-icon-big-swapright"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-big-swapleft</code></td>
<td><i class="m-icon-big-swapleft"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-big-swapup</code></td>
<td><i class="m-icon-big-swapup"></i></td>
</tr>
<tr>
<td scope="row"><code>.m-icon-big-swapdown</code></td>
<td><i class="m-icon-big-swapdown"></i></td>
</tr>
</table>
</div>
<p>You can also use the white counter-parts of the icons above by adding the <code>m-icon-white</code> class.</p>
</section>
<section>
<h3>Icon buttons</h3>
<p>
To create a button using an icon, add the
<code>icn-only</code> class. Then use the icon class inside the button, just as shown below.
</p>
<div class="example">
<a class="m-btn icn-only"><i class="icon-share"></i></a>
<a class="m-btn red icn-only"><i class="icon-remove icon-white"></i></a>
<a class="m-btn blue icn-only"><i class="m-icon-swapright m-icon-white"></i></a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn icn-only"><i class="icon-share"></i></a>
<a href="#" class="m-btn red icn-only"><i class="icon-remove icon-white"></i></a>
<a href="#" class="m-btn blue icn-only"><i class="m-icon-swapright m-icon-white"></i></a>
</code></pre>
<p>Grouping them together to achieve the same buttons for Gmail's paginator is quite easy.</p>
<div class="example">
<div class="m-btn-group">
<a class="m-btn icn-only"><i class="icon-chevron-left"></i></a>
<a class="m-btn icn-only"><i class="icon-chevron-right"></i></a>
</div>
</div>
<pre class="prettyprint"><code><div class="m-btn-group">
<a href="#" class="m-btn icn-only"><i class="icon-chevron-left"></i></a>
<a href="#" class="m-btn icn-only"><i class="icon-chevron-right"></i></a>
<div></code></pre>
<p>To create large icon buttons using the big swap arrows that was provided, just use the <code>bigicn-only</code>
CSS class.</p>
<div class="example">
<a class="m-btn bigicn-only"><i class="m-icon-big-swapright"></i></a>
<a class="m-btn bigicn-only green"><i class="m-icon-big-swapright m-icon-white"></i></a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn bigicn-only"><i class="m-icon-big-swapright"></i></a>
<a href="#" class="m-btn bigicn-only green"><i class="m-icon-big-swapright icon-white"></i></a></code></pre>
</section>
<section>
<h3>Buttons with both text and icon</h3>
<p>
So far we know how to create a button with text in it. We also have tackled how to create a button with only an icon in it.
This time let's get a bunch of buttons with both text and icon in it.
</p>
<div class="example">
<a class="m-btn mini red"><i class="icon-trash icon-white"></i> Delete</a>
<a class="m-btn"><i class="icon-plus"></i> Add Item</a>
<a class="m-btn purple-stripe">Listen to podcast <i class="icon-headphones"></i></a>
<a class="m-btn blue">Submit Entry <i class="icon-share-alt icon-white"></i></a>
<a class="m-btn purple big">See pricing options <i class="m-icon-big-swapright m-icon-white"></i></a>
</div>
<pre class="prettyprint"><code><a href="#" class="m-btn mini red"><i class="icon-trash"></i> Delete Item</a>
<a href="#" class="m-btn"><i class="icon-plus"></i> Add Item</a>
<a class="m-btn purple-stripe">Listen to podcast <i class="icon-headphones"></i></a>
<a href="#" class="m-btn blue"><i class="icon-plus"></i> Submit Entry</a>
<a class="m-btn purple big">See pricing options <i class="m-icon-big-swapright m-icon-white"></i></a></code></pre>
</section>
</div>
</div>
</div>
<!-- Footer
================================================== -->
<footer class="footer">
<div class="container">
<p>Created by <a href="http://twitter.com/twittstrap" target="_blank">@twittstrap</a>.</p>
<p>Twitter bootstrap was designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p><a href="http://glyphicons.com">Glyphicons Free</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p><a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p><a href="http://ace-subido.github.io/css3-microsoft-metro-buttons/"> CSS3 Microsoft Modern Buttons</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<ul class="footer-links">
<li><a href="http://blog.getbootstrap.com">Blog</a></li>
<li class="muted">·</li>
<li><a href="https://github.com/twitter/bootstrap/issues?state=open">Issues</a></li>
<li class="muted">·</li>
<li><a href="https://github.com/twitter/bootstrap/blob/master/CHANGELOG.md">Changelog</a></li>
</ul>
</div>
</footer>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap-transition.js"></script>
<script src="assets/js/bootstrap-alert.js"></script>
<script src="assets/js/bootstrap-modal.js"></script>
<script src="assets/js/bootstrap-dropdown.js"></script>
<script src="assets/js/bootstrap-scrollspy.js"></script>
<script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<script src="assets/js/bootstrap-collapse.js"></script>
<script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>
<script src="assets/js/bootstrap-affix.js"></script>
<script src="assets/js/holder/holder.js"></script>
<script src="assets/js/google-code-prettify/prettify.js"></script>
<script src="assets/js/application.js"></script>
</body>
</html>