Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / resources / themes / stylesheets / ext4 / default / widgets / _panel.scss
1 /**
2   * @class Ext.Panel
3   * Used to create the base structure of an Ext.Panel
4   */
5 @mixin extjs-panel {
6     .#{$prefix}panel,
7     .#{$prefix}plain {
8         overflow: hidden;
9         position: relative;
10     }
11     
12     // Workaround for disappearing right edge in IE6
13      @if $include-ie {
14         .#{$prefix}ie {
15             .#{$prefix}panel-header,
16             .#{$prefix}panel-header-tl,
17             .#{$prefix}panel-header-tc,
18             .#{$prefix}panel-header-tr,
19             .#{$prefix}panel-header-ml,
20             .#{$prefix}panel-header-mc,
21             .#{$prefix}panel-header-mr,
22             .#{$prefix}panel-header-bl,
23             .#{$prefix}panel-header-bc,
24             .#{$prefix}panel-header-br {
25                 zoom: 1;
26             }
27         }
28     }
29     
30     //panel header
31     .#{$prefix}panel-header {
32         padding: $panel-header-padding;
33     }
34     
35     .#{$prefix}panel-header-icon,
36     .#{$prefix}window-header-icon {
37         width:16px;
38         height:16px;
39         background-repeat:no-repeat;
40         background-position:0 0;
41         vertical-align:middle;
42         margin-right:4px;
43         margin-top:-1px;
44         margin-bottom:-1px;
45     }
46     
47     .#{$prefix}panel-header-draggable,
48     .#{$prefix}panel-header-draggable .#{$prefix}panel-header-text,
49     .#{$prefix}window-header-draggable,
50     .#{$prefix}window-header-draggable .#{$prefix}window-header-text{
51         cursor: move;
52     }
53
54     // A ghost is just a Panel. The only extra it needs is opacity.
55     // TODO: Make opacity a variable
56     .#{$prefix}panel-ghost, .#{$prefix}window-ghost {
57         @include opacity(0.65);
58         cursor: move;
59     }
60
61     .#{$prefix}panel-header-horizontal, .#{$prefix}window-header-horizontal, .#{$prefix}btn-group-header-horizontal {
62         .#{$prefix}panel-header-body, .#{$prefix}window-header-body, .#{$prefix}btn-group-header-body {
63             width: 100%;
64         }
65     }
66
67     .#{$prefix}panel-header-vertical, .#{$prefix}window-header-vertical, .#{$prefix}btn-group-header-vertical {
68         .#{$prefix}panel-header-body, .#{$prefix}window-header-body, .#{$prefix}btn-group-header-body {
69             height: 100%;
70         }
71     }
72
73     // Vertical headers must be inline blocks so that they acquire width from the content
74     .#{$prefix}panel-header-vertical, .#{$prefix}panel-header-vertical .#{$prefix}panel-header-body,
75     .#{$prefix}btn-group-header-vertical, .#{$prefix}btn-group-header-vertical .#{$prefix}btn-group-header-body,
76     .#{$prefix}window-header-vertical, .#{$prefix}window-header-vertical .#{$prefix}window-header-body {
77         display: -moz-inline-stack;
78         display: inline-block;
79     }
80
81     .#{$prefix}panel-header-text {
82         @include no-select;
83         white-space: nowrap;
84     }
85
86     .#{$prefix}panel-header-left,
87     .#{$prefix}panel-header-right {
88         .#{$prefix}vml-base {
89             left: -3px !important;
90         }
91     }
92
93     //panel body
94     .#{$prefix}panel-body {
95         overflow: hidden;
96         position: relative;
97     }
98
99     .#{$prefix}panel-header-vertical {
100         .#{$prefix}surface {
101             margin-top: 2px;
102         }
103     }
104     
105     .#{$prefix}panel-header-plain-vertical {
106         .#{$prefix}surface {
107             margin-top: 0;
108         }
109     }
110     
111         
112     .#{$prefix}panel-collapsed {
113         .#{$prefix}panel-header-collapsed-border-top {
114             border-bottom-width: $panel-header-border-width !important;
115         }
116         .#{$prefix}panel-header-collapsed-border-right {
117             border-left-width: $panel-header-border-width !important;
118         }
119         .#{$prefix}panel-header-collapsed-border-bottom {
120             border-top-width: $panel-header-border-width !important;
121         }
122         .#{$prefix}panel-header-collapsed-border-left {
123             border-right-width: $panel-header-border-width !important;
124         }
125     }
126
127     @if not $supports-gradients or $compile-all {
128         .#{$prefix}nlg .#{$prefix}panel-header-vertical {
129             .#{$prefix}frame-mc {
130                 background-repeat: repeat-y;
131             }
132         }
133     }
134
135     @if $include-panel-uis == true {
136         @include extjs-panel-ui(
137             'default',
138
139             $ui-base-color: $panel-base-color,
140             $ui-border-width: $panel-border-width,
141             $ui-border-color: $panel-border-color,
142             $ui-border-radius: $panel-border-radius,
143             
144             $ui-header-color: $panel-header-color,
145             $ui-header-font-size: $panel-header-font-size,
146             $ui-header-font-weight: $panel-header-font-weight,
147             $ui-header-border-color: $panel-header-border-color,
148             $ui-header-background-color: $panel-header-background-color,
149             $ui-header-background-gradient: $panel-header-background-gradient,
150
151             $ui-body-color: $panel-body-color,
152             $ui-body-border-color: $panel-body-border-color,
153             $ui-body-border-width: 1px,
154             $ui-body-background-color: $panel-body-background-color
155         );
156         
157         @include extjs-panel-ui(
158             'default-framed',
159
160             $ui-base-color: $panel-base-color,
161             $ui-border-width: $panel-frame-border-width,
162             $ui-border-color: $panel-frame-border-color,
163             $ui-border-radius: $panel-frame-border-radius,
164
165             $ui-header-color: $panel-header-color,
166             $ui-header-font-size: $panel-header-font-size,
167             $ui-header-font-weight: $panel-header-font-weight,
168             $ui-header-border-color: $panel-frame-border-color,
169             $ui-header-background-color: $panel-header-background-color,
170             $ui-header-background-gradient: $panel-header-background-gradient,
171
172             $ui-body-color: $panel-body-color,
173             $ui-body-border-color: $panel-body-border-color,
174             $ui-body-border-width: 0,
175             $ui-body-background-color: $panel-frame-background-color
176         );
177     }
178
179     .x-panel-header-plain,
180     .x-panel-body-plain {
181         border: 0;
182         padding: 0;
183     }
184 }
185
186 /**
187   * @class Ext.Panel
188   * Used to create a visual theme for an Ext.Panel
189   */
190 @mixin extjs-panel-ui(
191     $ui-label,
192
193     $ui-base-color: null,
194
195     $ui-border-color: null,
196     $ui-border-radius: null,
197     $ui-border-width: 0,
198
199     $ui-header-color: null,
200     $ui-header-font-family: $panel-header-font-family,
201     $ui-header-font-size: $panel-header-font-size,
202     $ui-header-font-weight: $panel-header-font-weight,
203     $ui-header-border-color: $ui-border-color,
204     $ui-header-background-color: null,
205     $ui-header-background-gradient: matte,
206     $ui-header-inner-border-color: null,
207
208     $ui-body-color: null,
209     $ui-body-border-color: null,
210     $ui-body-border-width: null,
211     $ui-body-border-style: solid,
212     $ui-body-background-color: null,
213     $ui-body-font-size: null,
214     $ui-body-font-weight: null
215 ){
216     @if $ui-base-color != null {
217         @if $ui-border-color == null { $ui-border-color: $ui-base-color; }
218
219         @if $ui-header-color == null { $ui-header-color: #fff; }
220         @if $ui-header-background-color == null { $ui-header-background-color: lighten($ui-base-color, 15); }
221     }
222     
223     @if $ui-header-inner-border-color == null and $ui-header-background-color != null {
224         $ui-header-inner-border-color: lighten($ui-header-background-color, 10);
225     }
226
227     .#{$prefix}panel-#{$ui-label} {
228         @if $ui-border-color != null { border-color: $ui-border-color; }
229     }
230
231     // header
232     .#{$prefix}panel-header-#{$ui-label} {
233         @if $ui-header-font-size != null { font-size: $ui-header-font-size; }
234         line-height: $panel-header-line-height;
235
236         @if $ui-header-border-color != null {
237             border-color: $ui-header-border-color;
238             border-width: $panel-header-border-width;
239             border-style: $panel-header-border-style;
240         }
241
242         @if $supports-gradients or $compile-all {
243             @if $ui-header-background-color != null { @include background-gradient($ui-header-background-color, $ui-header-background-gradient); }
244
245             @if $panel-header-inner-border and $ui-header-inner-border-color != null {
246                 @include inner-border(
247                     $width: $panel-header-inner-border-width,
248                     $color: $ui-header-inner-border-color
249                 );
250             }
251         }
252     }
253     
254     // header background images
255     @if $ui-header-background-color != null and $ui-header-background-gradient != null {
256         @if not $supports-gradients or $compile-all {
257             .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-top {
258                 background-image: theme-image($theme-name, 'panel-header/panel-header-#{$ui-label}-top-bg.gif');
259             }
260             
261             .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-bottom {
262                 background-image: theme-image($theme-name, 'panel-header/panel-header-#{$ui-label}-bottom-bg.gif');
263             }
264
265             .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-left {
266                 background-image: theme-image($theme-name, 'panel-header/panel-header-#{$ui-label}-left-bg.gif');
267             }
268
269             .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-right {
270                 background-image: theme-image($theme-name, 'panel-header/panel-header-#{$ui-label}-right-bg.gif');
271             }
272         }
273     }
274     
275     // header text
276     .#{$prefix}panel-header-text-#{$ui-label} {
277         @if $ui-header-color != null { color: $ui-header-color; }
278
279         @if $ui-header-font-size != null {   font-size: $ui-header-font-size; }
280         @if $ui-header-font-weight != null { font-weight: $ui-header-font-weight; }
281         @if $ui-header-font-family != null { font-family: $ui-header-font-family; }
282     }
283
284     // body
285     .#{$prefix}panel-body-#{$ui-label} {
286         @if $ui-body-background-color != null { background: $ui-body-background-color; }
287         @if $ui-body-border-color != null {     border-color: $ui-body-border-color; }
288         @if $ui-body-color != null {            color: $ui-body-color; }
289         @if $ui-body-font-size != null {        font-size: $ui-body-font-size; }
290         @if $ui-body-font-weight != null {      font-size: $ui-body-font-weight; }
291         
292         @if $ui-body-border-width != null {
293             border-width: $ui-body-border-width;
294             @if $ui-body-border-style != null { border-style: $ui-body-border-style; }
295         }
296     }
297     
298     .#{$prefix}panel-collapsed {
299         .#{$prefix}window-header-#{$ui-label},
300         .#{$prefix}panel-header-#{$ui-label} {
301             @if $ui-body-border-color != null { border-color: $ui-body-border-color; }
302         }
303     }
304
305     .#{$prefix}panel-header-#{$ui-label}-vertical {
306         @if $ui-body-border-color != null { border-color: $ui-body-border-color; }
307     }
308
309     @if $ui-base-color != null {
310         @if $supports-gradients or $compile-all {
311             .#{$prefix}panel-header-#{$ui-label}-left,
312             .#{$prefix}panel-header-#{$ui-label}-right {
313                 @include background-gradient($ui-header-background-color, $ui-header-background-gradient, right);
314             }
315         }
316     }
317
318     @if $ui-border-radius != null {
319         @include x-frame(
320             'panel',
321             $ui: '#{$ui-label}',
322
323             /* Radius, width, padding and background-color */
324             $border-radius   : $ui-border-radius,
325             $border-width    : $ui-border-width,
326             $padding         : $panel-frame-padding,
327             $background-color: $ui-body-background-color
328         );
329
330
331         @include x-frame('panel-header', '#{$ui-label}-top',    top($ui-border-radius) right($ui-border-radius) 0 0,    $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient);
332         @include x-frame('panel-header', '#{$ui-label}-right',  0 right($ui-border-radius) bottom($ui-border-radius) 0, $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient, false, right);
333         @include x-frame('panel-header', '#{$ui-label}-bottom', 0 0 bottom($ui-border-radius) left($ui-border-radius),  $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient);
334         @include x-frame('panel-header', '#{$ui-label}-left',   top($ui-border-radius) 0 0 left($ui-border-radius),     $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient, false, right);
335         
336         .#{$prefix}panel-header-#{$ui-label}-top {
337             @include inner-border(1px 1px 0 1px, $ui-header-inner-border-color);
338         }
339
340         .#{$prefix}panel-header-#{$ui-label}-right {
341             @include inner-border(1px 1px 1px 0, $ui-header-inner-border-color);
342         }
343
344         .#{$prefix}panel-header-#{$ui-label}-bottom {
345             @include inner-border(0 1px 1px 1px, $ui-header-inner-border-color);
346         }
347
348         .#{$prefix}panel-header-#{$ui-label}-left {
349             @include inner-border(1px 0 1px 1px, $ui-header-inner-border-color);
350         }
351     } @else {
352         .#{$prefix}panel-collapsed {
353             .#{$prefix}panel-header-#{$ui-label}-top {
354                 @include border-bottom-radius($ui-border-radius);
355             }
356
357             .#{$prefix}panel-header-#{$ui-label}-right {
358                 @include border-left-radius($ui-border-radius);
359             }
360
361             .#{$prefix}panel-header-#{$ui-label}-bottom {
362                 @include border-top-radius($ui-border-radius);
363             }
364
365             .#{$prefix}panel-header-#{$ui-label}-left {
366                 @include border-right-radius($ui-border-radius);
367             }
368         }
369         
370         .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-right {
371             background-position: top right;
372         }
373         
374         .#{$prefix}panel-header-#{$ui-label}-top {
375             @include inner-border(1px 0 0 0, $ui-header-inner-border-color);
376         }
377
378         .#{$prefix}panel-header-#{$ui-label}-right {
379             @include inner-border(0 1px 0 0, $ui-header-inner-border-color);
380         }
381
382         .#{$prefix}panel-header-#{$ui-label}-bottom {
383             @include inner-border(0 0 1px, $ui-header-inner-border-color);
384         }
385
386         .#{$prefix}panel-header-#{$ui-label}-left {
387             @include inner-border(0 0 0 1px, $ui-header-inner-border-color);
388         }
389     }
390     
391     .#{$prefix}nlg .#{$prefix}panel-header-#{$ui-label}-bottom {
392         background-position: bottom left;
393     }
394     
395     @if $ui-border-radius != null {
396         .#{$prefix}panel .#{$prefix}panel-header-#{$ui-label}-top {
397             border-bottom-width: 1px !important;
398         }
399
400         .#{$prefix}panel .#{$prefix}panel-header-#{$ui-label}-right {
401             border-left-width: 1px !important;
402         }
403
404         .#{$prefix}panel .#{$prefix}panel-header-#{$ui-label}-bottom {
405             border-top-width: 1px !important;
406         }
407
408         .#{$prefix}panel .#{$prefix}panel-header-#{$ui-label}-left {
409             border-right-width: 1px !important;
410         }
411         
412         .#{$prefix}panel-header-#{$ui-label}-collapsed {
413             @include border-radius($ui-border-radius);
414         }
415         
416         @include x-frame('panel-header', '#{$ui-label}-collapsed-top',    top($ui-border-radius) right($ui-border-radius) bottom($ui-border-radius) left($ui-border-radius), $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient);
417         @include x-frame('panel-header', '#{$ui-label}-collapsed-right',  top($ui-border-radius) right($ui-border-radius) bottom($ui-border-radius) left($ui-border-radius), $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient, false, right);
418         @include x-frame('panel-header', '#{$ui-label}-collapsed-bottom', top($ui-border-radius) right($ui-border-radius) bottom($ui-border-radius) left($ui-border-radius), $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient);
419         @include x-frame('panel-header', '#{$ui-label}-collapsed-left',   top($ui-border-radius) right($ui-border-radius) bottom($ui-border-radius) left($ui-border-radius), $ui-border-width, 4px 5px 4px 5px, $ui-header-background-color, $ui-header-background-gradient, false, right);
420     }
421     
422     //background positioning of images
423     .#{$prefix}panel-header-#{$ui-label}-right-tc,
424     .#{$prefix}panel-header-#{$ui-label}-right-mc,
425     .#{$prefix}panel-header-#{$ui-label}-right-bc {
426         background-position: right 0;
427     }
428     
429     .#{$prefix}panel-header-#{$ui-label}-bottom-tc,
430     .#{$prefix}panel-header-#{$ui-label}-bottom-mc,
431     .#{$prefix}panel-header-#{$ui-label}-bottom-bc {
432         background-position: 0 bottom;
433     }
434 }