##// END OF EJS Templates
Don't allow output to overflow page width.
Jonathan Frederic -
Show More
@@ -1,190 +1,192 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 // Don't let contents overflow page area.
96 overflow-x: auto;
95 padding: @code_padding;
97 padding: @code_padding;
96 .box-flex1();
98 .box-flex1();
97 }
99 }
98
100
99 /* The rest of the output_* classes are for special styling of the different
101 /* The rest of the output_* classes are for special styling of the different
100 output types */
102 output types */
101
103
102 /* all text output has this class: */
104 /* all text output has this class: */
103 div.output_text {
105 div.output_text {
104 text-align: left;
106 text-align: left;
105 color: @text-color;
107 color: @text-color;
106 /* This has to match that of the the CodeMirror class line-height below */
108 /* This has to match that of the the CodeMirror class line-height below */
107 line-height: @code_line_height;
109 line-height: @code_line_height;
108 }
110 }
109
111
110 /* stdout/stderr are 'text' as well as 'stream', but execute_result/error are *not* streams */
112 /* stdout/stderr are 'text' as well as 'stream', but execute_result/error are *not* streams */
111 div.output_stream {
113 div.output_stream {
112 }
114 }
113
115
114 div.output_stdout {
116 div.output_stdout {
115 }
117 }
116
118
117 div.output_stderr {
119 div.output_stderr {
118 background: #fdd; /* very light red background for stderr */
120 background: #fdd; /* very light red background for stderr */
119 }
121 }
120
122
121 div.output_latex {
123 div.output_latex {
122 text-align: left;
124 text-align: left;
123 }
125 }
124
126
125 div.output_html {
127 div.output_html {
126 }
128 }
127
129
128 div.output_png {
130 div.output_png {
129 }
131 }
130
132
131 div.output_jpeg {
133 div.output_jpeg {
132 }
134 }
133
135
134 /* Empty output_javascript divs should have no height */
136 /* Empty output_javascript divs should have no height */
135 div.output_javascript:empty {
137 div.output_javascript:empty {
136 padding: 0;
138 padding: 0;
137 }
139 }
138
140
139 .js-error {
141 .js-error {
140 color: darkred;
142 color: darkred;
141 }
143 }
142
144
143 /* raw_input styles */
145 /* raw_input styles */
144
146
145 div.raw_input_container {
147 div.raw_input_container {
146 font-family: @font-family-monospace;
148 font-family: @font-family-monospace;
147 // for some reason, em padding doesn't compute the same for raw_input
149 // for some reason, em padding doesn't compute the same for raw_input
148 // that is not the first input, but px does
150 // that is not the first input, but px does
149 padding-top: 5px;
151 padding-top: 5px;
150 }
152 }
151
153
152 span.raw_input_prompt {
154 span.raw_input_prompt {
153 /* nothing needed here */
155 /* nothing needed here */
154 }
156 }
155
157
156 input.raw_input {
158 input.raw_input {
157 font-family: inherit;
159 font-family: inherit;
158 font-size: inherit;
160 font-size: inherit;
159 color: inherit;
161 color: inherit;
160 width: auto;
162 width: auto;
161 /* make sure input baseline aligns with prompt */
163 /* make sure input baseline aligns with prompt */
162 vertical-align: baseline;
164 vertical-align: baseline;
163 /* padding + margin = 0.5em between prompt and cursor */
165 /* padding + margin = 0.5em between prompt and cursor */
164 padding: 0em 0.25em;
166 padding: 0em 0.25em;
165 margin: 0em 0.25em;
167 margin: 0em 0.25em;
166 }
168 }
167
169
168 input.raw_input:focus {
170 input.raw_input:focus {
169 box-shadow: none;
171 box-shadow: none;
170 }
172 }
171
173
172 p.p-space {
174 p.p-space {
173 margin-bottom: 10px;
175 margin-bottom: 10px;
174 }
176 }
175
177
176 div.output_unrecognized {
178 div.output_unrecognized {
177 padding: 5px;
179 padding: 5px;
178 font-weight: bold;
180 font-weight: bold;
179 color: red;
181 color: red;
180 // remove decoration from link
182 // remove decoration from link
181 a {
183 a {
182 color: inherit;
184 color: inherit;
183 text-decoration: none;
185 text-decoration: none;
184
186
185 &:hover {
187 &:hover {
186 color: inherit;
188 color: inherit;
187 text-decoration: none;
189 text-decoration: none;
188 }
190 }
189 }
191 }
190 }
192 }
General Comments 0
You need to be logged in to leave comments. Login now