Blame view

bower_components/iron-flex-layout/demo/index.html 10.4 KB
73bcce88   luigser   COMPONENTS
1
2
3
4
  <!doctype html>
  <!--
  @license
  Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
a1a3bc73   Luigi Serra   graphs updates
5
6
7
  This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
  The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
73bcce88   luigser   COMPONENTS
8
  Code distributed by Google as part of the polymer project is also
a1a3bc73   Luigi Serra   graphs updates
9
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
73bcce88   luigser   COMPONENTS
10
11
12
13
14
  -->
  
  <html>
  <head>
  
a1a3bc73   Luigi Serra   graphs updates
15
    <title>iron-flex-layout demo</title>
73bcce88   luigser   COMPONENTS
16
17
18
19
20
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
    <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
  
a1a3bc73   Luigi Serra   graphs updates
21
22
23
    <link rel="import" href="../../paper-styles/demo-pages.html">
    <link rel="import" href="demo-snippet.html">
    <link rel="import" href="../iron-flex-layout.html">
73bcce88   luigser   COMPONENTS
24
25
  
    <style>
a1a3bc73   Luigi Serra   graphs updates
26
27
28
29
30
31
32
33
34
35
      .container {
        background-color: #ccc;
        padding: 5px;
        margin: 0;
      }
      .container > div {
        padding: 15px;
        margin: 5px;
        background-color: white;
        min-height: 20px;
73bcce88   luigser   COMPONENTS
36
37
      }
  
a1a3bc73   Luigi Serra   graphs updates
38
39
      demo-snippet {
        width: 100%;
73bcce88   luigser   COMPONENTS
40
41
      }
  
a1a3bc73   Luigi Serra   graphs updates
42
43
44
      .vertical-section {
        padding: 0 !important;
      }
73bcce88   luigser   COMPONENTS
45
46
47
    </style>
  
  </head>
a1a3bc73   Luigi Serra   graphs updates
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
  <body unresolved class="fullbleed">
  
    <h4>Horizontal and vertical layout</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex {
              @apply(--layout-horizontal);
            }
          </style>
  
          <div class="container flex">
            <div>one</div>
            <div>two</div>
            <div>three</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Flexible children</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-horizontal {
              @apply(--layout-horizontal);
            }
            .flexchild {
              @apply(--layout-flex);
            }
          </style>
  
          <div class="container flex-horizontal">
            <div>one</div>
            <div class="flexchild">two (flex)</div>
            <div>three</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Flexible children in vertical layouts</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-vertical {
              @apply(--layout-vertical);
              height: 220px;
            }
            .flexchild-vertical {
              @apply(--layout-flex);
            }
          </style>
  
          <div class="container flex-vertical">
            <div>one</div>
            <div class="flexchild-vertical">two (flex)</div>
            <div>three</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Flex ratios</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-horizontal-with-ratios {
              @apply(--layout-horizontal);
            }
            .flexchild {
              @apply(--layout-flex);
            }
            .flex2child {
              @apply(--layout-flex-2);
            }
            .flex3child {
              @apply(--layout-flex-3);
            }
          </style>
  
          <div class="container flex-horizontal-with-ratios">
            <div class="flex3child">one</div>
            <div class="flexchild">two</div>
            <div class="flex2child">three</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Cross-axis stretch alignment (default)</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-stretch-align {
              @apply(--layout-horizontal);
              height: 120px;
            }
          </style>
  
          <div class="container flex-stretch-align">
            <div>stretch</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Cross-axis center alignment</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-center-align {
              @apply(--layout-horizontal);
              @apply(--layout-center);
              height: 120px;
            }
          </style>
  
          <div class="container flex-center-align">
            <div>center</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Cross-axis start alignment</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-start-align {
              @apply(--layout-horizontal);
              @apply(--layout-start);
              height: 120px;
            }
          </style>
  
          <div class="container flex-start-align">
            <div>start</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Cross-axis end alignment</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-end-align {
              @apply(--layout-horizontal);
              @apply(--layout-end);
              height: 120px;
            }
          </style>
  
          <div class="container flex-end-align">
            <div>end</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Justification, start justified</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-start-justified {
              @apply(--layout-horizontal);
              @apply(--layout-start-justified);
            }
          </style>
  
          <div class="container flex-start-justified">
            <div>start-justified</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Justification, start justified</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-center-justified {
              @apply(--layout-horizontal);
              @apply(--layout-center-justified);
            }
          </style>
  
          <div class="container flex-center-justified">
            <div>center-justified</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Justification, end justified</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-end-justified {
              @apply(--layout-horizontal);
              @apply(--layout-end-justified);
            }
          </style>
  
          <div class="container flex-end-justified">
            <div>end-justified</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Justification, equal space between elements</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-equal-justified {
              @apply(--layout-horizontal);
              @apply(--layout-justified);
            }
          </style>
  
          <div class="container flex-equal-justified">
            <div>justified</div>
            <div>justified</div>
            <div>justified</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Justification, equal space around each element</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-equal-around-justified {
              @apply(--layout-horizontal);
              @apply(--layout-around-justified);
            }
          </style>
  
          <div class="container flex-equal-around-justified">
            <div>around-justified</div>
            <div>around-justified</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Self alignment</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-self-align {
              @apply(--layout-horizontal);
              @apply(--layout-justified);
              height: 120px;
            }
            .flex-self-align div {
              @apply(--layout-flex);
            }
            .child1 {
              @apply(--layout-self-start);
            }
            .child2 {
              @apply(--layout-self-center);
            }
            .child3 {
              @apply(--layout-self-end);
            }
            .child4 {
              @apply(--layout-self-stretch);
            }
          </style>
  
          <div class="container flex-self-align">
            <div class="child1">one</div>
            <div class="child2">two</div>
            <div class="child3">three</div>
            <div class="child4">four</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Wrapping</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-wrap {
              @apply(--layout-horizontal);
              @apply(--layout-wrap);
              width: 200px;
            }
          </style>
  
          <div class="container flex-wrap">
            <div>one</div>
            <div>two</div>
            <div>three</div>
            <div>four</div>
          </div>
        </template>
      </demo-snippet>
    </div>
  
    <h4>Reversed layouts</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .flex-reversed {
              @apply(--layout-horizontal-reverse);
            }
          </style>
  
          <div class="container flex-reversed">
            <div>one</div>
            <div>two</div>
            <div>three</div>
            <div>four</div>
          </div>
        </template>
      </demo-snippet>
    </div>
73bcce88   luigser   COMPONENTS
388
  
a1a3bc73   Luigi Serra   graphs updates
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
    <h4>General purpose ruls</h4>
    <div class="vertical-section">
      <demo-snippet>
        <template>
          <style is="custom-style">
            .general {
              width: 100%;
            }
            .general > div {
              background-color: #ccc;
              padding: 4px;
              margin: 12px;
            }
            .block {
              @apply(--layout-block);
            }
            .invisible {
              @apply(--layout-invisible);
            }
            .relative {
              @apply(--layout-relative);
            }
            .fit {
              @apply(--layout-fit);
            }
          </style>
73bcce88   luigser   COMPONENTS
415
  
a1a3bc73   Luigi Serra   graphs updates
416
417
418
419
420
421
422
423
424
425
426
          <div class="general">
            <div>Before <span>[A Span]</span> After</div>
            <div>Before <span class="block">[A Block Span]</span> After</div>
            <div>Before invisible span <span class="invisible">Not displayed</span> After invisible span</div>
            <div class="relative" style="height: 100px;">
              <div class="fit" style="background-color: #000;color: white">Fit</div>
            </div>
          </div>
        </template>
      </demo-snippet>
    </div>
73bcce88   luigser   COMPONENTS
427
428
  </body>
  </html>