Fork me on GitHub

metro.css stylesheets and then some

about

Much like the Twitter Bootstrap project (which was one of the inspirations for this project), the site uses LESS to build the stylesheets on-the-fly. So if you wanted to test this locally, you'd need something like Jekyll or our own Pretzel to serve up the content (as the generation is done using Javascript and you will likely encounter file:// permission issues).

While you can just go and grab the code from GitHub, feel free to click around the site and see more for yourself.


Typography

Headings, paragraphs, lists, and other inline type elements

Headings

h1. Heading 1

h2. Heading 2

h3. Heading 3

h4. Heading 4

h5. Heading 5
h6. Heading 6

Metro headings change, depending on the size. Large headings should be a light weight font and lowercase, but as it gets smaller, switch to regular weightings and uppercase to increase legibility.

Fonts

Segoe UI is the prefered font for metro interfaces, but it isn't available on all platforms. We plan to use Segoe UI, Segoe WP, Helvetica Neue, Roboto, sans-serif

As it is difficult to compare against fonts you can't install/embed, here is an image demonstrating the different fonts


colours

Windows Phone colours, or add your own (and compile from Less)

The following colours are available for foreground text colour by using class="accentname", that is class="lime" or for backgrounds class="accentnamebg" or class="limebg"

Lime
Blue (default)
Brown
Green
Magenta
Orange
Pink
Purple
Teal
Red
There is also an accent class. If you're compiling from Less, open up variables.less and change @accent to your desired accent colour - this will save a whole lot of search/replace!

Controls

Reusable components are built to provide the complete metro experience.

Pivot (tabs)

Windows Phone 7 introduced the "Pivot" control, which in any other language would be described as a tab - the only difference being the transition between each frame, and the adjusting tab header positions.

Using jQuery Metro, we can achieve this relatively easily.

Example

tab1

Topping bear claw lemon drops. Cake powder gingerbread. Powder halvah powder danish. Cookie gingerbread muffin wypas cake marzipan dessert. Pastry jelly beans tootsie roll dessert wypas gingerbread pastry candy toffee. Sweet roll cupcake halvah. Gingerbread cotton candy tiramisu muffin carrot cake chocolate sweet roll donut. Applicake toffee halvah toffee dragée toffee candy canes sesame snaps cheesecake. Sweet powder lollipop apple pie candy halvah chupa chups croissant. Jelly beans bear claw soufflé apple pie. Gummies ice cream marzipan tootsie roll wypas carrot cake. Bonbon lemon drops candy gummi bears lemon drops lollipop. Powder caramels jelly.

tab2

Topping bear claw lemon drops. Cake powder gingerbread. Powder halvah powder danish. Cookie gingerbread muffin wypas cake marzipan dessert. Pastry jelly beans tootsie roll dessert wypas gingerbread pastry candy toffee. Sweet roll cupcake halvah. Gingerbread cotton candy tiramisu muffin carrot cake chocolate sweet roll donut. Applicake toffee halvah toffee dragée toffee candy canes sesame snaps cheesecake. Sweet powder lollipop apple pie candy halvah chupa chups croissant. Jelly beans bear claw soufflé apple pie. Gummies ice cream marzipan tootsie roll wypas carrot cake. Bonbon lemon drops candy gummi bears lemon drops lollipop. Powder caramels jelly.

tab3

Topping bear claw lemon drops. Cake powder gingerbread. Powder halvah powder danish. Cookie gingerbread muffin wypas cake marzipan dessert. Pastry jelly beans tootsie roll dessert wypas gingerbread pastry candy toffee. Sweet roll cupcake halvah. Gingerbread cotton candy tiramisu muffin carrot cake chocolate sweet roll donut. Applicake toffee halvah toffee dragée toffee candy canes sesame snaps cheesecake. Sweet powder lollipop apple pie candy halvah chupa chups croissant. Jelly beans bear claw soufflé apple pie. Gummies ice cream marzipan tootsie roll wypas carrot cake. Bonbon lemon drops candy gummi bears lemon drops lollipop. Powder caramels jelly.

Usage

<div class="metro-pivot">
	<div class="pivot-item">
		<h3>tab1</h3>
		<p> content </p>
	</div>	
	<div class="pivot-item">
		<h3>tab2</h3>
		<p> content</p>
	</div>	
</div>
		

Include the following Javascript

<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery.metro.js"></script>
		

and add the following to a script block to activate. TODO: Reset the defaults to this!

var defaults = {
		animationDuration: 350,
		headerOpacity: 0.25,
		fixedHeaders: false,
		headerSelector: function (item) { return item.children("h3").first(); },
		itemSelector: function (item) { return item.children(".pivot-item"); },
		headerItemTemplate: function () { return $("<span class='header' />"); },
		pivotItemTemplate: function () { return $("<div class='pivotItem' />"); },
		itemsTemplate: function () { return $("<div class='items' />"); },
		headersTemplate: function () { return $("<div class='headers' />"); },
		controlInitialized: undefined,
		selectedItemChanged: undefined
	};

$(function () {
	$("div.metro-pivot").metroPivot(defaults);
});

Tiles

usage

<div class="tiles">
	<div class="tilerow">
		<div class="tile two-v bluebg"><a href="#">content</div>
		<div class="tile one bluebg"><a href="#">content</div>
		<div class="tile one bluebg"><a href="#">content</div>
		<div class="tile two-h bluebg"><a href="#">content</div>
	</div>
</div>

In the above example, the first tile would be two tiles high, and the fourth would be two tiles width. To cope with extra wide or extra high tiles, you can use offset classes, firstcol, secondcol, thirdcol, fourthcol and fifthcol

To enable tilt on tiles, you need to include scripts/tilt.js (and jquery), then in your footer.

$(function () {
	$(".tile").each(addTileTilt);
}

example

test

test

test

test

test

progress bars

Taken from bootstrap.

active progress bars


demos

Downloads

You can grab the latest and compile the Less, or grab the pre-generated css for each accent colour.

CSS

These are all completely standalone, depending on what accent colour you want. It should be pre-minified.

Fonts

Unfortunately as mentioned above, only Roboto can be distributed. It's not required, just on systems without Segoe UI or Helvetica Neue, Roboto is the next best choice before falling back to sans-serif

Download

Javascript

This contains the tile tilt and pivot Javascript files - just add jQuery.

Download