OLD | NEW |
| (Empty) |
1 <!-- | |
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
6 Code distributed by Google as part of the polymer project is also | |
7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
8 --><!-- | |
9 `<core-layout-trbl>` arranges nodes horizontally via absolute positioning. | |
10 Set the `vertical` attribute (boolean) to arrange vertically instead. | |
11 | |
12 `<core-layout-trbl>` arranges it's <b>sibling elements</b>, not | |
13 it's children. | |
14 | |
15 One arranged node may be marked as elastic by giving it a `flex` | |
16 attribute (boolean). | |
17 | |
18 You may remove a node from layout by giving it a `nolayout` | |
19 attribute (boolean). | |
20 | |
21 CSS Notes: | |
22 | |
23 `padding` is ignored on the parent node. | |
24 `margin` is ignored on arranged nodes. | |
25 `min-width` is ignored on arranged nodes, use `min-width` on the parent node | |
26 instead. | |
27 | |
28 Example: | |
29 | |
30 Arrange three `div` into columns. `flex` attribute on Column Two makes that | |
31 column elastic. | |
32 | |
33 <core-layout-trbl></core-layout-trbl> | |
34 <div>Column One</div> | |
35 <div flex>Column Two</div> | |
36 <div>Column Three</div> | |
37 | |
38 Remember that `<core-layout-trbl>` arranges it's sibling elements, not it's chil
dren. | |
39 | |
40 If body has width 52 device pixels (in this case, ascii characters), call that 5
2px. | |
41 Column One has it's natural width of 12px (including border), Column Three has i
t's | |
42 natural width of 14px, body border uses 2px, and Column Two automatically uses t
he | |
43 remaining space: 24px. | |
44 | |
45 |- 52px -| | |
46 ---------------------------------------------------- | |
47 ||Column One|| Column Two ||Column Three|| | |
48 ---------------------------------------------------- | |
49 |- 12px -||- (24px) -|| 14px -| | |
50 | |
51 As the parent node resizes, the elastic column reacts via CSS to adjust it's siz
e. | |
52 No javascript is used during parent resizing, for best performance. | |
53 | |
54 Changes in content or sibling size are not handled automatically. | |
55 | |
56 ---------------------------------------------------------------- | |
57 ||Column One| Column Two |Column Three|| | |
58 ---------------------------------------------------------------- | |
59 | |
60 -------------------------------------- | |
61 ||Column One|Column Two|Column Three|| | |
62 -------------------------------------- | |
63 | |
64 Arrange in rows by adding the `vertical` attribute. | |
65 | |
66 Example: | |
67 | |
68 <core-layout-trbl vertical></core-layout-trbl> | |
69 <div>Row One</div> | |
70 <div flex>Row Two</div> | |
71 <div>Row Three</div> | |
72 | |
73 This setup will cause Row Two to stretch to fill the container. | |
74 | |
75 ----------- ----------- | |
76 |---------| |---------| | |
77 | | | | | |
78 |Row One | |Row One | | |
79 | | | | | |
80 |---------| |---------| | |
81 | | | | | |
82 |Row Two | |Row Two | | |
83 | | | | | |
84 |---------| | | | |
85 | | | | | |
86 |Row Three| | | | |
87 | | |---------| | |
88 |---------| | | | |
89 ----------- |Row Three| | |
90 | | | |
91 |---------| | |
92 |---------| | |
93 | |
94 Layouts can be nested arbitrarily. | |
95 | |
96 <core-layout-trbl></core-layout-trbl> | |
97 <div>Menu</div> | |
98 <div flex> | |
99 <core-layout-trbl vertical></core-layout-trbl> | |
100 <div>Title</div> | |
101 <div>Toolbar</div> | |
102 <div flex>Main</div> | |
103 <div>Footer</div> | |
104 </div> | |
105 | |
106 Renders something like this | |
107 | |
108 -------------------------------- | |
109 ||Menu ||Title || | |
110 || ||-----------------|| | |
111 || ||Toolbar || | |
112 || ||-----------------|| | |
113 || ||Main || | |
114 || || || | |
115 || ||-----------------|| | |
116 || ||Footer || | |
117 -------------------------------- | |
118 | |
119 @group Polymer Core Elements | |
120 @element core-layout-trbl | |
121 --><html><head><link rel="import" href="../polymer/polymer.html"> | |
122 | |
123 </head><body><polymer-element name="core-layout-trbl" attributes="vertical" asse
tpath=""> | |
124 | |
125 <template> | |
126 | |
127 <style> | |
128 :host { | |
129 display: none; | |
130 } | |
131 </style> | |
132 | |
133 </template> | |
134 | |
135 | |
136 | |
137 </polymer-element> | |
138 <script charset="utf-8" src="core-layout-trbl-extracted.js"></script></body></ht
ml> | |
OLD | NEW |