##// END OF EJS Templates
Prevent output images from being larger than their container.
Jonathan Frederic -
Show More
@@ -1,190 +1,197 b''
1 div.output_wrapper {
1 div.output_wrapper {
2 /* this position must be relative to enable descendents to be absolute within it */
2 /* this position must be relative to enable descendents to be absolute within it */
3 position: relative;
3 position: relative;
4 .vbox()
4 .vbox()
5 }
5 }
6
6
7 /* class for the output area when it should be height-limited */
7 /* class for the output area when it should be height-limited */
8 div.output_scroll {
8 div.output_scroll {
9 /* ideally, this would be max-height, but FF barfs all over that */
9 /* ideally, this would be max-height, but FF barfs all over that */
10 height: 24em;
10 height: 24em;
11 /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */
11 /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */
12 width: 100%;
12 width: 100%;
13
13
14 overflow: auto;
14 overflow: auto;
15 .corner-all;
15 .corner-all;
16 .box-shadow(inset 0 2px 8px rgba(0, 0, 0, .8));
16 .box-shadow(inset 0 2px 8px rgba(0, 0, 0, .8));
17 display: block;
17 display: block;
18 }
18 }
19
19
20 /* output div while it is collapsed */
20 /* output div while it is collapsed */
21 div.output_collapsed {
21 div.output_collapsed {
22 margin: 0px;
22 margin: 0px;
23 padding: 0px;
23 padding: 0px;
24 .vbox();
24 .vbox();
25 }
25 }
26
26
27 div.out_prompt_overlay {
27 div.out_prompt_overlay {
28 height: 100%;
28 height: 100%;
29 padding: 0px @code_padding;
29 padding: 0px @code_padding;
30 position: absolute;
30 position: absolute;
31 .corner-all;
31 .corner-all;
32 }
32 }
33
33
34 div.out_prompt_overlay:hover {
34 div.out_prompt_overlay:hover {
35 /* use inner shadow to get border that is computed the same on WebKit/FF */
35 /* use inner shadow to get border that is computed the same on WebKit/FF */
36 .box-shadow(inset 0 0 1px #000);
36 .box-shadow(inset 0 0 1px #000);
37 background: rgba(240, 240, 240, 0.5);
37 background: rgba(240, 240, 240, 0.5);
38 }
38 }
39
39
40 div.output_prompt {
40 div.output_prompt {
41 color: @output_prompt_color;
41 color: @output_prompt_color;
42 }
42 }
43
43
44 /* This class is the outer container of all output sections. */
44 /* This class is the outer container of all output sections. */
45 div.output_area {
45 div.output_area {
46 padding: 0px;
46 padding: 0px;
47 page-break-inside: avoid;
47 page-break-inside: avoid;
48 .hbox();
48 .hbox();
49
49
50 .MathJax_Display {
50 .MathJax_Display {
51 // Inside a CodeCell, elements are left justified
51 // Inside a CodeCell, elements are left justified
52 text-align: left !important;
52 text-align: left !important;
53 }
53 }
54
54
55 .rendered_html {
55 .rendered_html {
56 // Inside a CodeCell, elements are left justified
56 // Inside a CodeCell, elements are left justified
57 table {
57 table {
58 margin-left: 0;
58 margin-left: 0;
59 margin-right: 0;
59 margin-right: 0;
60 }
60 }
61
61
62 img {
62 img {
63 margin-left: 0;
63 margin-left: 0;
64 margin-right: 0;
64 margin-right: 0;
65 }
65 }
66 }
66 }
67 }
67 }
68
68
69 /* This is needed to protect the pre formating from global settings such
69 /* This is needed to protect the pre formating from global settings such
70 as that of bootstrap */
70 as that of bootstrap */
71 .output {
71 .output {
72 .vbox();
72 .vbox();
73 }
73 }
74
74
75 @media (max-width: @screen-xs-min) {
75 @media (max-width: @screen-xs-min) {
76 // move prompts above output on small screens
76 // move prompts above output on small screens
77 div.output_area {
77 div.output_area {
78 .vbox();
78 .vbox();
79 }
79 }
80 }
80 }
81
81
82 div.output_area pre {
82 div.output_area pre {
83 margin: 0;
83 margin: 0;
84 padding: 0;
84 padding: 0;
85 border: 0;
85 border: 0;
86 vertical-align: baseline;
86 vertical-align: baseline;
87 color: @output_pre_color;
87 color: @output_pre_color;
88 background-color: transparent;
88 background-color: transparent;
89 .border-radius(0);
89 .border-radius(0);
90 }
90 }
91
91
92 /* This class is for the output subarea inside the output_area and after
92 /* This class is for the output subarea inside the output_area and after
93 the prompt div. */
93 the prompt div. */
94 div.output_subarea {
94 div.output_subarea {
95 padding: @code_padding;
95 padding: @code_padding;
96 .box-flex1();
96 .box-flex1();
97 }
97 }
98
98
99 /* The rest of the output_* classes are for special styling of the different
99 /* The rest of the output_* classes are for special styling of the different
100 output types */
100 output types */
101
101
102 /* all text output has this class: */
102 /* all text output has this class: */
103 div.output_text {
103 div.output_text {
104 text-align: left;
104 text-align: left;
105 color: @text-color;
105 color: @text-color;
106 /* This has to match that of the the CodeMirror class line-height below */
106 /* This has to match that of the the CodeMirror class line-height below */
107 line-height: @code_line_height;
107 line-height: @code_line_height;
108 }
108 }
109
109
110 /* stdout/stderr are 'text' as well as 'stream', but execute_result/error are *not* streams */
110 /* stdout/stderr are 'text' as well as 'stream', but execute_result/error are *not* streams */
111 div.output_stream {
111 div.output_stream {
112 }
112 }
113
113
114 div.output_stdout {
114 div.output_stdout {
115 }
115 }
116
116
117 div.output_stderr {
117 div.output_stderr {
118 background: #fdd; /* very light red background for stderr */
118 background: #fdd; /* very light red background for stderr */
119 }
119 }
120
120
121 div.output_latex {
121 div.output_latex {
122 text-align: left;
122 text-align: left;
123 }
123 }
124
124
125 div.output_html {
125 div.output_html {
126 }
126 }
127
127
128 div.output_png {
128 div.output_png {
129 }
129 }
130
130
131 div.output_jpeg {
131 div.output_jpeg {
132 }
132 }
133
133
134 // Prevent the image outputs from being wider than the page.
135 div.output_png div.ui-wrapper,
136 div.output_svg div.ui-wrapper,
137 div.output_jpeg div.ui-wrapper {
138 max-width: 100%
139 }
140
134 /* Empty output_javascript divs should have no height */
141 /* Empty output_javascript divs should have no height */
135 div.output_javascript:empty {
142 div.output_javascript:empty {
136 padding: 0;
143 padding: 0;
137 }
144 }
138
145
139 .js-error {
146 .js-error {
140 color: darkred;
147 color: darkred;
141 }
148 }
142
149
143 /* raw_input styles */
150 /* raw_input styles */
144
151
145 div.raw_input_container {
152 div.raw_input_container {
146 font-family: @font-family-monospace;
153 font-family: @font-family-monospace;
147 // for some reason, em padding doesn't compute the same for raw_input
154 // for some reason, em padding doesn't compute the same for raw_input
148 // that is not the first input, but px does
155 // that is not the first input, but px does
149 padding-top: 5px;
156 padding-top: 5px;
150 }
157 }
151
158
152 span.raw_input_prompt {
159 span.raw_input_prompt {
153 /* nothing needed here */
160 /* nothing needed here */
154 }
161 }
155
162
156 input.raw_input {
163 input.raw_input {
157 font-family: inherit;
164 font-family: inherit;
158 font-size: inherit;
165 font-size: inherit;
159 color: inherit;
166 color: inherit;
160 width: auto;
167 width: auto;
161 /* make sure input baseline aligns with prompt */
168 /* make sure input baseline aligns with prompt */
162 vertical-align: baseline;
169 vertical-align: baseline;
163 /* padding + margin = 0.5em between prompt and cursor */
170 /* padding + margin = 0.5em between prompt and cursor */
164 padding: 0em 0.25em;
171 padding: 0em 0.25em;
165 margin: 0em 0.25em;
172 margin: 0em 0.25em;
166 }
173 }
167
174
168 input.raw_input:focus {
175 input.raw_input:focus {
169 box-shadow: none;
176 box-shadow: none;
170 }
177 }
171
178
172 p.p-space {
179 p.p-space {
173 margin-bottom: 10px;
180 margin-bottom: 10px;
174 }
181 }
175
182
176 div.output_unrecognized {
183 div.output_unrecognized {
177 padding: 5px;
184 padding: 5px;
178 font-weight: bold;
185 font-weight: bold;
179 color: red;
186 color: red;
180 // remove decoration from link
187 // remove decoration from link
181 a {
188 a {
182 color: inherit;
189 color: inherit;
183 text-decoration: none;
190 text-decoration: none;
184
191
185 &:hover {
192 &:hover {
186 color: inherit;
193 color: inherit;
187 text-decoration: none;
194 text-decoration: none;
188 }
195 }
189 }
196 }
190 }
197 }
General Comments 0
You need to be logged in to leave comments. Login now