YUI recommends YUI 3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
Layout skinning is done via CSS. The Layout Manager comes with a default skin, but you can extend or override this as needed.
The Layout Manager's base class is a starting point for skinning a Layout. Include this file and use the skin file as a reference for your new skin (you can view the full contents of the base class here).
Once you have the base class in place, you can proceed to customize the look and feel of your Layout by working with the skinning file. Starting with the Sam Skin version below is generally the fastest approach, allowing you to customize just those parts of the skin that will make your implementation resonate with the overall design of your application.
1 | /* Remove the dotted border on the resize proxy */ |
2 | .yui-skin-sam .yui-layout .yui-resize-proxy { |
3 | border: none; |
4 | font-size: 0; |
5 | margin: 0; |
6 | padding: 0; |
7 | } |
8 | /* During resize, hide the handles */ |
9 | .yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle { |
10 | opacity: 0; |
11 | filter: alpha(opacity=0); |
12 | } |
13 | /* Style the div inside the resize proxy */ |
14 | .yui-skin-sam .yui-layout .yui-resize-proxy div { |
15 | position: absolute; |
16 | border: 1px solid #808080; |
17 | background-color: #EDF5FF; |
18 | } |
19 | /* Set the color of the Active resize handle */ |
20 | .yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active { |
21 | background-color: #EDF5FF; |
22 | } |
23 | /* Styles for the left handle */ |
24 | .yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l { |
25 | width: 5px; |
26 | height: 100%; |
27 | top: 0; |
28 | left: 0; |
29 | } |
30 | /* Styles for the right handle */ |
31 | .yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r { |
32 | width: 5px; |
33 | top: 0; |
34 | right: 0; |
35 | height: 100%; |
36 | } |
37 | /* Styles for the bottom handle */ |
38 | .yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b { |
39 | width: 100%; |
40 | bottom: 0; |
41 | left: 0; |
42 | height: 5px; |
43 | } |
44 | /* Styles for the top handle */ |
45 | .yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t { |
46 | width: 100%; |
47 | top: 0; |
48 | left: 0; |
49 | height: 5px; |
50 | } |
51 | |
52 | /* Left Collapse button */ |
53 | .yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse { |
54 | background: transparent url(layout_sprite.png) no-repeat -20px -160px; |
55 | border: 1px solid #808080; |
56 | } |
57 | /* Left Collapsed Expand Button */ |
58 | .yui-skin-sam .yui-layout .yui-layout-clip-left .collapse { |
59 | background: transparent url(layout_sprite.png) no-repeat -20px -140px; |
60 | border: 1px solid #808080; |
61 | } |
62 | /* Right Collapse Button */ |
63 | .yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse { |
64 | background: transparent url(layout_sprite.png) no-repeat -20px -200px; |
65 | border: 1px solid #808080; |
66 | } |
67 | /* Right Collapsed Expand Button */ |
68 | .yui-skin-sam .yui-layout .yui-layout-clip-right .collapse { |
69 | background: transparent url(layout_sprite.png) no-repeat -20px -120px; |
70 | border: 1px solid #808080; |
71 | } |
72 | /* Top Collapse Button */ |
73 | .yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse { |
74 | background: transparent url(layout_sprite.png) no-repeat -20px -220px; |
75 | border: 1px solid #808080; |
76 | } |
77 | /* Top Collapsed Expand Button */ |
78 | .yui-skin-sam .yui-layout .yui-layout-clip-top .collapse { |
79 | background: transparent url(layout_sprite.png) no-repeat -20px -240px; |
80 | border: 1px solid #808080; |
81 | } |
82 | /* Bottom Collapse Button */ |
83 | .yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse { |
84 | background: transparent url(layout_sprite.png) no-repeat -20px -260px; |
85 | border: 1px solid #808080; |
86 | } |
87 | /* Bottom Collapsed Expand Button */ |
88 | .yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse { |
89 | background: transparent url(layout_sprite.png) no-repeat -20px -180px; |
90 | border: 1px solid #808080; |
91 | } |
92 | /* Close Button */ |
93 | .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close { |
94 | background: transparent url(layout_sprite.png) no-repeat -20px -100px; |
95 | border: 1px solid #808080; |
96 | } |
97 | |
98 | /* Give the header a blue backgorund */ |
99 | .yui-skin-sam .yui-layout .yui-layout-hd { |
100 | background:url(sprite.png) repeat-x 0 -1400px; |
101 | border: 1px solid #808080; |
102 | } |
103 | /* Set the background color */ |
104 | .yui-skin-sam .yui-layout { |
105 | background-color: #EDF5FF; |
106 | } |
107 | /* Style the text in the header */ |
108 | .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2 { |
109 | font-weight: bold; |
110 | color: #fff; |
111 | padding: 3px; |
112 | } |
113 | /* Style the body */ |
114 | .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd { |
115 | border: 1px solid #808080; |
116 | border-bottom: none; |
117 | border-top: none; |
118 | *border-bottom-width: 0; |
119 | *border-top-width: 0; |
120 | background-color: #f2f2f2; |
121 | text-align: left; |
122 | } |
123 | /* Add a border to the bottom of the body because there is no footer */ |
124 | .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft { |
125 | border-bottom: 1px solid #808080; |
126 | } |
127 | /* Add a border to the top of the body because there is no header */ |
128 | .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { |
129 | border-top: 1px solid #808080; |
130 | } |
131 | |
132 | /* Style the Clip */ |
133 | .yui-skin-sam .yui-layout .yui-layout-clip { |
134 | position: absolute; |
135 | height: 20px; |
136 | background-color: #EDF5FF; |
137 | display: none; |
138 | border: 1px solid #808080; |
139 | } |
140 | /* Style the footer */ |
141 | .yui-skin-sam .yui-layout div.yui-layout-ft { |
142 | border: 1px solid #808080; |
143 | border-top: none; |
144 | *border-top-width: 0; |
145 | background-color: #f2f2f2; |
146 | } |
147 | |
148 | /* Remove the color from the resize handle */ |
149 | .yui-skin-sam .yui-layout-unit .yui-resize-handle { |
150 | background-color: transparent; |
151 | } |
152 | /* Reposition the handles */ |
153 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-r { |
154 | right: 0; |
155 | top: 0; |
156 | background-image: none; |
157 | } |
158 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-l { |
159 | left: 0; |
160 | top: 0; |
161 | background-image: none; |
162 | } |
163 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-b { |
164 | right: 0; |
165 | bottom: 0; |
166 | background-image: none; |
167 | } |
168 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-t { |
169 | right: 0; |
170 | top: 0; |
171 | background-image: none; |
172 | } |
173 | /* Add the gripper */ |
174 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob, |
175 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob { |
176 | position: absolute; |
177 | height: 16px; |
178 | width: 6px; |
179 | top: 45%; |
180 | left: 0px; |
181 | background: transparent url(layout_sprite.png) no-repeat 0 -5px; |
182 | } |
183 | /* Add the gripper */ |
184 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob, |
185 | .yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob { |
186 | position: absolute; |
187 | height: 6px; |
188 | width: 16px; |
189 | left: 45%; |
190 | background: transparent url(layout_sprite.png) no-repeat -20px 0; |
191 | } |
view plain | print | ? |
You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.
Copyright © 2011 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Copyright Policy - Job Openings