Yahoo! Developer Network Home - Help

YUI Library Examples: Resize Utility (beta): Skinning the Resize Utility

Resize Utility (beta): Skinning the Resize Utility

Resize skinning is done via CSS. The Resize Utility comes with a default skin, but you can extend or override this as needed.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse justo nibh, pharetra at, adipiscing ullamcorper.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse justo nibh, pharetra at, adipiscing ullamcorper.

Resize Utility's core CSS file

The Resize Utility's base class is a starting point for skinning the Resize Utility. 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).

Sam's skin CSS file

Once you have the base class in place, you can proceed to customize the look and feel of your Resize Utility by working with the skinnning 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/* Give the handle a background color */ 
2.yui-skin-sam .yui-resize .yui-resize-handle { 
3    background-color: #F2F2F2
4} 
5/* Give the active handle a different color */ 
6.yui-skin-sam .yui-resize .yui-resize-handle-active { 
7    background-color: #7D98B8
8    zoom1
9} 
10/* Give a border to the 8-way knob style handles */ 
11.yui-skin-sam .yui-resize-knob .yui-resize-handle { 
12    border1px solid #808080
13} 
14/* Show the active handle when hovered */ 
15.yui-skin-sam .yui-resize-hover .yui-resize-handle-active { 
16    opacity1
17    filteralpha(opacity=100); 
18} 
19 
20/* Style the resize proxy */ 
21.yui-skin-sam .yui-resize-proxy { 
22    border1px dashed #426FD9
23} 
24 
25/* Style the status box similar to a tooltip */ 
26.yui-skin-sam .yui-resize-status { 
27    border1px solid #A6982B; 
28    border-top1px solid #D4C237
29    background-color: #FFEE69 
30} 
31 
32 
33/* Style the content of the status box */ 
34.yui-skin-sam .yui-resize-status strong, .yui-skin-sam .yui-resize-status em { 
35    floatleft
36    displayblock
37    clearboth
38    padding1px
39    text-aligncenter
40} 
41 
42/* Setup the gripper */ 
43.yui-skin-sam .yui-resize .yui-resize-handle-inner-r, 
44.yui-skin-sam .yui-resize .yui-resize-handle-inner-l { 
45    backgroundtransparent url( layout_sprite.png) no-repeat 0 -5px
46    height16px
47    width5px
48    positionabsolute
49    top45%
50} 
51 
52/* Setup the gripper */ 
53.yui-skin-sam .yui-resize .yui-resize-handle-inner-t, 
54.yui-skin-sam .yui-resize .yui-resize-handle-inner-b { 
55    backgroundtransparent url(layout_sprite.png) no-repeat -20px 0
56    height5px
57    width16px
58    positionabsolute
59    left50%
60} 
61 
62/* Bottom Right Gripper */ 
63.yui-skin-sam .yui-resize .yui-resize-handle-br { 
64    background-imageurl( layout_sprite.png ); 
65    background-repeatno-repeat
66    background-position-22px -62px
67} 
68 
69/* Top Right Gripper */ 
70.yui-skin-sam .yui-resize .yui-resize-handle-tr { 
71    background-imageurl( layout_sprite.png ); 
72    background-repeatno-repeat
73    background-position-22px -42px
74} 
75 
76/* Top Left Gripper */ 
77.yui-skin-sam .yui-resize .yui-resize-handle-tl { 
78    background-imageurl( layout_sprite.png ); 
79    background-repeatno-repeat
80    background-position-22px -82px
81} 
82 
83/* Bottom Left Gripper */ 
84.yui-skin-sam .yui-resize .yui-resize-handle-bl { 
85    background-imageurl( layout_sprite.png ); 
86    background-repeatno-repeat
87    background-position-22px -23px
88} 
89 
90/* Remove the background image from the 8-way knobs */ 
91.yui-skin-sam .yui-resize-knob .yui-resize-handle-t, 
92.yui-skin-sam .yui-resize-knob .yui-resize-handle-r, 
93.yui-skin-sam .yui-resize-knob .yui-resize-handle-b, 
94.yui-skin-sam .yui-resize-knob .yui-resize-handle-l, 
95.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl, 
96.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr, 
97.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl, 
98.yui-skin-sam .yui-resize-knob .yui-resize-handle-br, 
99.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t, 
100.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r, 
101.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b, 
102.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l, 
103.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl, 
104.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr, 
105.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl, 
106.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br { 
107    background-imagenone
108} 
view plain | print | ?

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings