Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Add inline demo for readme (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelli authored Apr 18, 2017
1 parent 375eb66 commit e07a6cf
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
21 changes: 21 additions & 0 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ The classes listed here are included in the `iron-flex` module of the `iron-flex
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -271,6 +272,7 @@ The classes listed here are included in the `iron-flex` module of the `iron-flex
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -331,6 +333,7 @@ The same rules can be used for children in vertical layouts.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -400,6 +403,7 @@ The classes listed here are included in the `iron-flex-factors` module of the `i
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -456,6 +460,7 @@ By default, children stretch to fit the cross-axis (e.g. _vertical_ stretching i
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -495,6 +500,7 @@ by adding the `center` class or applying the `--layout-center` mixin.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -531,6 +537,7 @@ by adding the `center` class or applying the `--layout-center` mixin.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -579,6 +586,7 @@ classes, or by applying the `--layout-start` or `--layout-end` mixins.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -615,6 +623,7 @@ classes, or by applying the `--layout-start` or `--layout-end` mixins.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -658,6 +667,7 @@ classes, or by applying the `--layout-start` or `--layout-end` mixins.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -694,6 +704,7 @@ classes, or by applying the `--layout-start` or `--layout-end` mixins.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -753,6 +764,7 @@ The classes listed here are included in the `iron-flex-alignment` module of the
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -789,6 +801,7 @@ The classes listed here are included in the `iron-flex-alignment` module of the
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -832,6 +845,7 @@ The classes listed here are included in the `iron-flex-alignment` module of the
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -868,6 +882,7 @@ The classes listed here are included in the `iron-flex-alignment` module of the
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -913,6 +928,7 @@ The classes listed here are included in the `iron-flex-alignment` module of the
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -961,6 +977,7 @@ Class | Mixin | Result
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -1000,6 +1017,7 @@ Class | Mixin | Result
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -1070,6 +1088,7 @@ Wrapped layouts can be enabled with the `wrap` class or `--layout-wrap` mixin.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -1121,6 +1140,7 @@ The classes listed here are included in the `iron-flex-reverse` module of the `i
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout.html">
<dom-module id="demo-element">
<template>
Expand Down Expand Up @@ -1209,6 +1229,7 @@ to fit inside of.
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
Expand Down
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build status](https://travis-ci.org/PolymerElements/iron-flex-layout.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-flex-layout)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://beta.webcomponents.org/element/PolymerElements/iron-flex-layout)

##&lt;iron-flex-layout&gt;
## &lt;iron-flex-layout&gt;

The `<iron-flex-layout>` component provides simple ways to use
[CSS flexible box layout](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes),
Expand All @@ -14,13 +14,41 @@ in every element that needs to use them.

Sample use:

<link rel="import" href="../iron-flex-layout/iron-flex-layout-classes.html">
<!--
```
<custom-element-demo>
<template>
<script src="../webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="iron-flex-layout-classes.html">
<dom-module id="demo-element">
<template>
<style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style>
.container, .layout {
background-color: #ccc;
padding: 4px;
}
<style is="custom-style" include="iron-flex iron-flex-alignment"></style>

<div class="layout horizontal layout-start">
<div>cross axis start alignment</div>
</div>
.container div, .layout div {
background-color: white;
padding: 12px;
margin: 4px;
}
</style>
<next-code-block></next-code-block>
</template>
<script>Polymer({is: "demo-element"});</script>
</dom-module>
<demo-element></demo-element>
</template>
</custom-element-demo>
```
-->
```html
<div class="layout horizontal layout-start" style="height: 154px">
<div>cross axis start alignment</div>
</div>
```

1. [Custom CSS mixins](https://github.com/PolymerElements/iron-flex-layout/blob/master/iron-flex-layout.html).
The mixin stylesheet includes custom CSS mixins that can be applied inside a CSS rule using the `@apply` function.
Expand Down

0 comments on commit e07a6cf

Please sign in to comment.