##// END OF EJS Templates
- Fixed CSS so it also applies to widgets within modals...
Jonathan Frederic -
Show More
@@ -1,233 +1,241 b''
1
1
2 /*
2 /*
3 LESS file that styles IPython notebook widgets and the area they sit in.
3 LESS file that styles IPython notebook widgets and the area they sit in.
4
4
5 The widget area typically looks something like this:
5 The widget area typically looks something like this:
6 +------------------------------------------+
6 +------------------------------------------+
7 | widget-area |
7 | widget-area |
8 | +--------+---------------------------+ |
8 | +--------+---------------------------+ |
9 | | prompt | widget-subarea | |
9 | | prompt | widget-subarea | |
10 | | | +--------+ +--------+ | |
10 | | | +--------+ +--------+ | |
11 | | | | widget | | widget | | |
11 | | | | widget | | widget | | |
12 | | | +--------+ +--------+ | |
12 | | | +--------+ +--------+ | |
13 | +--------+---------------------------+ |
13 | +--------+---------------------------+ |
14 +------------------------------------------+
14 +------------------------------------------+
15 */
15 */
16
16
17 .widget-area {
17 .widget-area {
18 page-break-inside: avoid;
18 page-break-inside: avoid;
19 .hbox();
19 .hbox();
20
20
21 .widget-subarea {
21 .widget-subarea {
22 padding: 0.44em 0.4em 0.4em 1px;
22 padding: 0.44em 0.4em 0.4em 1px;
23 margin-left: 6px;
23 margin-left: 6px;
24 .border-box-sizing();
24 .border-box-sizing();
25 .vbox();
25 .vbox();
26 .box-flex2();
26 .box-flex2();
27 }
28 }
29
30 /* THE CLASSES BELOW CAN APPEAR ANYWHERE IN THE DOM */
27
31
28 /* Horizontal Label */
32 /* Horizontal Label */
29 .widget-hlabel {
33 .widget-hlabel {
30 min-width: 10ex;
34 min-width: 10ex;
31 padding-right: 8px;
35 padding-right: 8px;
32 padding-top: 3px;
36 padding-top: 3px;
33 text-align: right;
37 text-align: right;
34 vertical-align: text-top;
38 vertical-align: text-top;
35 }
39 }
36
40
37 /* Vertical Label */
41 /* Vertical Label */
38 .widget-vlabel {
42 .widget-vlabel {
39 padding-bottom: 5px;
43 padding-bottom: 5px;
40 text-align: center;
44 text-align: center;
41 vertical-align: text-bottom;
45 vertical-align: text-bottom;
42 }
46 }
43
47
44
48
45 /* Slider Track */
49 /* Slider Track */
46 .slide-track {
50 .slide-track {
47 border: 1px solid #CCCCCC;
51 border: 1px solid #CCCCCC;
48 background: #FFFFFF;
52 background: #FFFFFF;
49 .corner-all(); /* Round the corners of the slide track */
53 .corner-all(); /* Round the corners of the slide track */
50 }
54 }
51
55
52 /* Horizontal jQuery Slider
56 /* Horizontal jQuery Slider
53
57
54 Both the horizontal and vertical versions of the slider are characterized
58 Both the horizontal and vertical versions of the slider are characterized
55 by a styled div that contains an invisible jQuery slide div which
59 by a styled div that contains an invisible jQuery slide div which
56 contains a visible slider handle div. This is requred so we can control
60 contains a visible slider handle div. This is requred so we can control
57 how the slider is drawn and 'fix' the issue where the slide handle
61 how the slider is drawn and 'fix' the issue where the slide handle
58 doesn't stop at the end of the slide.
62 doesn't stop at the end of the slide.
59
63
60 Both horizontal and vertical sliders have this div nesting:
64 Both horizontal and vertical sliders have this div nesting:
61 +------------------------------------------+
65 +------------------------------------------+
62 | widget-(h/v)slider |
66 | widget-(h/v)slider |
63 | +--------+---------------------------+ |
67 | +--------+---------------------------+ |
64 | | ui-slider | |
68 | | ui-slider | |
65 | | +------------------+ | |
69 | | +------------------+ | |
66 | | | ui-slider-handle | | |
70 | | | ui-slider-handle | | |
67 | | +------------------+ | |
71 | | +------------------+ | |
68 | +--------+---------------------------+ |
72 | +--------+---------------------------+ |
69 +------------------------------------------+
73 +------------------------------------------+
70 */
74 */
71 .widget-hslider {
75 .widget-hslider {
72
76
73 /* Fix the padding of the slide track so the ui-slider is sized
77 /* Fix the padding of the slide track so the ui-slider is sized
74 correctly. */
78 correctly. */
75 padding-left: 8px;
79 padding-left: 8px;
76 padding-right: 5px;
80 padding-right: 5px;
77 overflow: visible;
81 overflow: visible;
78
82
79 /* Default size of the slider */
83 /* Default size of the slider */
80 width: 348px;
84 width: 348px;
81 height: 5px;
85 height: 5px;
82 max-height: 5px;
86 max-height: 5px;
83 margin-top: 11px;
87 margin-top: 11px;
84
88
85 /* Style the slider track */
89 /* Style the slider track */
86 .slide-track();
90 .slide-track();
87
91
88 /* Make the div a flex box (makes FF behave correctly). */
92 /* Make the div a flex box (makes FF behave correctly). */
89 .hbox();
93 .hbox();
90
94
91 /* Inner, invisible slide div */
95 /* Inner, invisible slide div */
92 .ui-slider {
96 .ui-slider {
93 border: 0px !important;
97 border: 0px !important;
94 background: none !important;
98 background: none !important;
95
99
96 .hbox();
100 .hbox();
97 .box-flex1();
101 .box-flex1();
98
102
99 .ui-slider-handle {
103 .ui-slider-handle {
100 width: 14px !important;
104 width: 14px !important;
101 height: 28px !important;
105 height: 28px !important;
102
106
103 margin-top: -8px !important;
107 margin-top: -8px !important;
104 }
108 }
105 }
109 }
106 }
110 }
107
111
108 /* Vertical jQuery Slider */
112 /* Vertical jQuery Slider */
109 .widget-vslider {
113 .widget-vslider {
110
114
111 /* Fix the padding of the slide track so the ui-slider is sized
115 /* Fix the padding of the slide track so the ui-slider is sized
112 correctly. */
116 correctly. */
113 padding-bottom: 8px;
117 padding-bottom: 8px;
114 overflow: visible;
118 overflow: visible;
115
119
116 /* Default size of the slider */
120 /* Default size of the slider */
117 width: 5px;
121 width: 5px;
118 max-width: 5px;
122 max-width: 5px;
119 height: 250px;
123 height: 250px;
120 margin-left: 12px;
124 margin-left: 12px;
121
125
122 /* Style the slider track */
126 /* Style the slider track */
123 .slide-track();
127 .slide-track();
124
128
125 /* Make the div a flex box (makes FF behave correctly). */
129 /* Make the div a flex box (makes FF behave correctly). */
126 .vbox();
130 .vbox();
127
131
128 /* Inner, invisible slide div */
132 /* Inner, invisible slide div */
129 .ui-slider {
133 .ui-slider {
130 border: 0px !important;
134 border: 0px !important;
131 background: none !important;
135 background: none !important;
132 margin-left: -4px;
136 margin-left: -4px;
133 margin-top: 5px;
137 margin-top: 5px;
134
138
135 .vbox();
139 .vbox();
136 .box-flex1();
140 .box-flex1();
137
141
138 .ui-slider-handle {
142 .ui-slider-handle {
139 width: 28px !important;
143 width: 28px !important;
140 height: 14px !important;
144 height: 14px !important;
141 margin-left: -9px;
145 margin-left: -9px;
142 }
146 }
143 }
147 }
144 }
148 }
145
149
146 /* String Textbox - used for TextBoxView and TextAreaView */
150 /* String Textbox - used for TextBoxView and TextAreaView */
147 .widget-text {
151 .widget-text {
148 width: 350px;
152 width: 350px;
149 margin-bottom: 0px;
153 margin-bottom: 0px;
150 }
154 }
151
155
152 /* Listbox */
156 /* Listbox */
153 .widget-listbox {
157 .widget-listbox {
154 width: 364px;
158 width: 364px;
155 margin-bottom: 0px;
159 margin-bottom: 0px;
156 }
160 }
157
161
158 /* Single Line Textbox - used for IntTextView and FloatTextView */
162 /* Single Line Textbox - used for IntTextView and FloatTextView */
159 .widget-numeric-text {
163 .widget-numeric-text {
160 width: 150px;
164 width: 150px;
161 }
165 }
162
166
163 /* Progress Bar */
167 /* Progress Bar */
164 .widget-progress {
168 .widget-progress {
165 width: 363px;
169 width: 363px;
166
170
167 /* Disable progress bar animation */
171 /* Disable progress bar animation */
168 .bar {
172 .bar {
169 -webkit-transition: none;
173 -webkit-transition: none;
170 -moz-transition: none;
174 -moz-transition: none;
171 -ms-transition: none;
175 -ms-transition: none;
172 -o-transition: none;
176 -o-transition: none;
173 transition: none;
177 transition: none;
174 }
178 }
175 }
179 }
176
180
177 /* ComboBox Main Button */
181 /* ComboBox Main Button */
178 .widget-combo-btn {
182 .widget-combo-btn {
179 min-width: 138px; /* + 26px drop arrow btn = 164px */
183 min-width: 138px; /* + 26px drop arrow btn = 164px */
180 }
184 }
181
185
182 /* The following section sets the style for the invisible div that
186 /* The following section sets the style for the invisible div that
183 hold widgets and their accompanying labels.
187 hold widgets and their accompanying labels.
184
188
185 Looks like this:
189 Looks like this:
186 +-----------------------------+
190 +-----------------------------+
187 | widget-box (or similar) |
191 | widget-box (or similar) |
188 | +-------+---------------+ |
192 | +-------+---------------+ |
189 | | Label | Actual Widget | |
193 | | Label | Actual Widget | |
190 | +-------+---------------+ |
194 | +-------+---------------+ |
191 +-----------------------------+
195 +-----------------------------+
192 */
196 */
193 .widget-box {
197 .widget-box {
194 .start();
198 .start();
195 .widget-container();
199 .widget-container();
196 margin: 5px;
200 margin: 5px;
197 }
201 }
198 .widget-hbox { /* Horizontal widgets */
202 .widget-hbox { /* Horizontal widgets */
199 .widget-box();
203 .widget-box();
200 .hbox();
204 .hbox();
201 }
205 }
202 .widget-hbox-single { /* Single line horizontal widgets */
206 .widget-hbox-single { /* Single line horizontal widgets */
203 .widget-hbox();
207 .widget-hbox();
204 height: 30px;
208 height: 30px;
205 }
209 }
206 .widget-vbox-single { /* For vertical slides */
210 .widget-vbox-single { /* For vertical slides */
207 .widget-box();
211 .widget-box();
208 .vbox();
212 .vbox();
209 width: 30px;
213 width: 30px;
210 }
214 }
211 }
212 }
213
214 /* THE CLASSES BELOW CAN APPEAR ANYWHERE IN THE DOM */
215
216 /* ContainerWidget - ModalView */
215 /* ContainerWidget - ModalView */
217 .widget-modal {
216 .widget-modal {
218 overflow: hidden;
217 overflow: hidden;
219 position: absolute !important;
218 position: absolute !important;
220 top: 0px;
219 top: 0px;
221 left: 0px;
220 left: 0px;
222 margin-left: 0px !important;
221 margin-left: 0px !important;
223 }
222 }
224
223
225 /* ContainerWidget - ModalView Body */
224 /* ContainerWidget - ModalView Body */
226 .widget-modal-body {
225 .widget-modal-body {
227 max-height: none !important;
226 max-height: none !important;
228 }
227 }
229
228
230 /* ContainerWidget */
229 /* ContainerWidget */
231 .widget-container {
230 .widget-container {
232 .border-box-sizing();
231 .border-box-sizing();
233 }
232 }
233
234 /* Horizontal Label */
235 .docked-widget-modal {
236 overflow: hidden;
237 position: relative !important;
238 top: 0px !important;
239 left: 0px !important;
240 margin-left: 0px !important;
241 }
General Comments 0
You need to be logged in to leave comments. Login now