Debian Codegraph @

inst/www/shared/shiny_scss/shiny.scss

raw
1 // DEFAULTS
2 $shiny-disconnected-bg: #999 !default;
3 $shiny-table-na: #909090 !default;
4 $shiny-error-color: red !default;
5 $shiny-error-validated-color: #888 !default;
6 $shiny-progress-text-bg-color: #eef8ff !default; // TODO: what is this actually for?
7 $shiny-input-width: 300px !default;
8 $shiny-input-panel-bg: #f5f5f5 !default;
9 $shiny-input-panel-border: 1px solid #e3e3e3 !default;
10 $shiny-input-panel-border-radius: 2px !default;
11 $shiny-text-output-border-radius: null !default;
12 $notification-bg-color: #e8e8e8 !default;
13 $notification-color: #333 !default;
14 $notification-border: 1px solid #ccc !default;
15 $notification-border-radius: 3px !default;
16 $notification-padding: 10px 2rem 10px 10px !default;
17 $notification-message-bg: #d9edf7 !default;
18 $notification-message-color: #31708f !default;
19 $notification-message-border: 1px solid #bce8f1 !default;
20 $notification-warning-bg: #fcf8e3 !default;
21 $notification-warning-color: #8a6d3b !default;
22 $notification-warning-border: 1px solid #faebcc !default;
23 $notification-error-bg: #f2dede !default;
24 $notification-error-color: #a94442 !default;
25 $notification-error-border: 1px solid #ebccd1 !default;
26 $notification-close-color: #444 !default;
27 $notification-close-hover-color: #000 !default;
28 $notification-content-action-color: #337ab7 !default;
29 $datepicker-disabled-color: #aaa !default;
30 $shiny-file-active-shadow: inset 0 1px 1px rgba(black, .075), 0 0 8px rgba(102, 175, 233, .6) !default;
31 $shiny-file-over-shadow: inset 0 1px 1px rgba(black, .075), 0 0 8px rgba(76, 174, 76, .6) !default;
32
33 // DECLARATIONS
34 @mixin table-padding($top: null, $right: null, $bottom: null, $left: null) {
35 > thead, > tbody, > tfoot {
36 > tr {
37 > th, > td {
38 padding-top: $top;
39 padding-right: $right;
40 padding-bottom: $bottom;
41 padding-left: $left;
42 }
43 }
44 }
45 }
46
47 // Both BS3 and BS4 define a border radius mixin, but just in case
48 // we're trying to compile this without bootstrapSass
49 @mixin border-radius-shim($radius) {
50 @if mixin-exists("border-radius") {
51 @include border-radius($radius);
52 } @else {
53 border-radius: $radius;
54 }
55 }
56
57
58 // RULES
59
60 /* This is necessary so that an empty verbatimTextOutput slot
61 is the same height as a non-empty one (only important when
62 * placeholder = TRUE) */
63 pre.shiny-text-output:empty::before {
64 content: " ";
65 }
66
67 pre.shiny-text-output.noplaceholder:empty {
68 margin: 0;
69 padding: 0;
70 border-width: 0;
71 height: 0;
72 }
73
74 /* Some browsers (like Safari) will wrap text in <pre> tags with Bootstrap's
75 CSS. This changes the behavior to not wrap.
76 */
77 pre.shiny-text-output {
78 word-wrap: normal;
79 @include border-radius-shim($shiny-text-output-border-radius);
80 }
81
82 .shiny-image-output, .shiny-plot-output {
83 img.shiny-scalable {
84 max-width: 100%;
85 max-height: 100%;
86 }
87 }
88
89 #shiny-disconnected-overlay {
90 position: fixed;
91 inset: 0;
92 background-color: $shiny-disconnected-bg;
93 opacity: 0.5;
94 overflow: hidden;
95 z-index: 99998;
96 pointer-events: none;
97 }
98
99 html.autoreload-enabled #shiny-disconnected-overlay.reloading {
100 opacity: 0;
101 animation: fadeIn 250ms forwards;
102 animation-delay: 1s;
103 }
104 @keyframes fadeIn {
105 to {
106 opacity: 0.1;
107 }
108 }
109
110 .table.shiny-table {
111 @include table-padding($left: 12px, $right: 12px);
112 }
113
114 .shiny-table {
115 &.spacing {
116 &-xs {
117 @include table-padding($top: 3px, $bottom: 3px);
118 }
119 &-s {
120 @include table-padding($top: 5px, $bottom: 5px);
121 }
122 &-m {
123 @include table-padding($top: 8px, $bottom: 8px);
124 }
125 &-l {
126 @include table-padding($top: 10px, $bottom: 10px);
127 }
128 }
129 .NA {
130 color: $shiny-table-na;
131 }
132 }
133
134 .shiny-output-error {
135 color: $shiny-error-color;
136 white-space: pre-wrap;
137 &:before {
138 content: 'Error: ';
139 font-weight: bold;
140 }
141 &-validation {
142 color: $shiny-error-validated-color;
143 }
144 &-validation:before {
145 content: '';
146 font-weight: inherit;
147 }
148 }
149
150
151 /* Work around MS Edge transition bug (issue #1637) */
152 @supports (-ms-ime-align:auto) {
153 .shiny-bound-output {
154 transition: 0;
155 }
156 }
157
158 .recalculating {
159 --_shiny-fade-opacity: var(--shiny-fade-opacity, 0.3);
160 opacity: var(--_shiny-fade-opacity);
161 transition: opacity 250ms ease 500ms;
162 }
163
164 .slider-animate-container {
165 text-align: right;
166 margin-top: -9px;
167 }
168 .slider-animate-button {
169 /* Ensure controls above slider line touch target */
170 position: relative;
171 z-index: 1;
172 opacity: 0.5;
173 .pause {
174 display: none;
175 }
176 &.playing .pause {
177 display: inline;
178 }
179 .play {
180 display: inline;
181 }
182 &.playing .play {
183 display: none;
184 }
185 }
186
187 .progress {
188 &.shiny-file-input-progress {
189 visibility: hidden;
190 .progress-bar.bar-danger {
191 transition: none;
192 }
193 }
194 }
195
196 // fileInput()'s button should never have a top-right or bottom-right border-radius
197 .btn-file {
198 border-top-right-radius: 0 !important;
199 border-bottom-right-radius: 0 !important;
200 }
201
202 /* Make sure the filename doesn't extend past the bounds of the container */
203 .shiny-input-container input[type=file] {
204 overflow: hidden;
205 max-width: 100%;
206 }
207
208 /* Old-style progress */
209 .shiny-progress-container {
210 position: fixed;
211 top: 0px;
212 width: 100%;
213 /* Make sure it draws above all Bootstrap components */
214 z-index: 2000;
215 }
216
217 // TODO: should respect more Bootstrap Sass vars?
218 .shiny-progress {
219 .progress {
220 position: absolute;
221 width: 100%;
222 top: 0px;
223 height: 3px;
224 margin: 0px;
225 }
226 .bar {
227 opacity: 0.6;
228 transition-duration: 250ms;
229 }
230 .progress-text {
231 position: absolute;
232 right: 10px;
233 width: 240px;
234 background-color: $shiny-progress-text-bg-color;
235 margin: 0px;
236 padding: 2px 3px;
237 opacity: 0.85;
238 .progress-message {
239 padding: 0px 3px;
240 font-weight: bold;
241 font-size: 90%;
242 }
243 .progress-detail {
244 padding: 0px 3px;
245 font-size: 80%;
246 }
247 }
248 }
249
250 /* New-style progress (uses notifications API) */
251 .shiny-progress-notification {
252 .progress {
253 margin-bottom: 5px;
254 height: 10px;
255 }
256 .progress-text {
257 .progress-message {
258 font-weight: bold;
259 font-size: 90%;
260 }
261 .progress-detail {
262 font-size: 80%;
263 }
264 }
265 }
266
267 .shiny-label-null {
268 display: none;
269 }
270
271 .crosshair {
272 cursor: crosshair;
273 }
274
275 .grabbable {
276 cursor: grab;
277 cursor: -moz-grab;
278 cursor: -webkit-grab;
279 }
280
281 .grabbing {
282 cursor: grabbing;
283 cursor: -moz-grabbing;
284 cursor: -webkit-grabbing;
285 }
286
287 .ns-resize {
288 cursor: ns-resize;
289 }
290
291 .ew-resize {
292 cursor: ew-resize;
293 }
294
295 .nesw-resize {
296 cursor: nesw-resize;
297 }
298
299 .nwse-resize {
300 cursor: nwse-resize;
301 }
302
303
304 /* Workaround for Qt, which doesn't use font fallbacks */
305 .qt pre, .qt code {
306 font-family: monospace !important;
307 }
308
309 /* Workaround for Qt 5, which draws its own margins around checks and radios;
310 overrides the top margin on these elements set by Bootstrap */
311 .qt5 .radio input[type="radio"],
312 .qt5 .checkbox input[type="checkbox"] {
313 margin-top: 0px;
314 }
315
316 /* Workaround for radio buttons and checkboxes not showing on Qt on Mac.
317 This occurs in the RStudio IDE on macOS 11.5.
318 https://github.com/rstudio/shiny/issues/3484
319 */
320 .qtmac input[type="radio"],
321 .qtmac input[type="checkbox"] {
322 zoom: 1.0000001;
323 }
324
325 .shiny-frame {
326 border: none;
327 }
328
329 .shiny-flow-layout {
330 > div {
331 display: inline-block;
332 vertical-align: top;
333 padding-right: 12px;
334 width: 220px;
335 }
336 }
337 .shiny-split-layout {
338 width: 100%;
339 white-space: nowrap;
340 > div {
341 display: inline-block;
342 vertical-align: top;
343 box-sizing: border-box;
344 overflow: auto;
345 }
346 }
347
348 .shiny-input-panel {
349 padding: 6px 8px;
350 margin-top: 6px;
351 margin-bottom: 6px;
352 background-color: $shiny-input-panel-bg;
353 border: $shiny-input-panel-border;
354 @include border-radius-shim($shiny-input-panel-border-radius);
355 }
356
357 /* For checkbox groups and radio buttons, bring the options closer to label,
358 if label is present. */
359 .shiny-input-checkboxgroup label ~ .shiny-options-group,
360 .shiny-input-radiogroup label ~ .shiny-options-group {
361 margin-top: -10px;
362 }
363
364 /* Checkbox groups and radios that are inline need less negative margin to
365 separate from label. */
366 .shiny-input-checkboxgroup.shiny-input-container-inline label ~ .shiny-options-group,
367 .shiny-input-radiogroup.shiny-input-container-inline label ~ .shiny-options-group {
368 margin-top: -1px;
369 }
370
371 /* Limit the width of inputs in the general case. */
372 .shiny-input-container:not(.shiny-input-container-inline) {
373 width: $shiny-input-width;
374 max-width: 100%;
375 }
376
377 /* Don't limit the width of inputs in a sidebar. */
378 .well .shiny-input-container {
379 width: auto;
380 }
381
382 /* Width of non-selectize select inputs */
383 .shiny-input-container > div > select:not(.selectized) {
384 width: 100%;
385 }
386
387 /* Styling for textAreaInput(autoresize=TRUE) */
388 textarea.textarea-autoresize.form-control {
389 padding: 5px 8px;
390 resize: none;
391 overflow-y: hidden;
392 height: auto;
393 }
394
395
396 #shiny-notification-panel {
397 position: fixed;
398 bottom: 0;
399 right: 0;
400 background-color: rgba(0,0,0,0);
401 padding: 2px;
402 width: 300px;
403 max-width: 100%;
404 z-index: 99999;
405 }
406
407 .shiny-notification {
408 position: relative;
409 background-color: $notification-bg-color;
410 color: $notification-color;
411 border: $notification-border;
412 @include border-radius-shim($notification-border-radius);
413 opacity: 0.85;
414 padding: $notification-padding;
415 margin: 5px;
416 &-message {
417 color: $notification-message-color;
418 background-color: $notification-message-bg;
419 border: $notification-message-border;
420 }
421 &-warning {
422 color: $notification-warning-color;
423 background-color: $notification-warning-bg;
424 border: $notification-warning-border;
425 }
426 &-error {
427 color: $notification-error-color;
428 background-color: $notification-error-bg;
429 border: $notification-error-border;
430 }
431 &-close {
432 position: absolute;
433 width: 2rem;
434 height: 2rem;
435 top: 0;
436 right: 0;
437 display: flex;
438 align-items: center;
439 justify-content: center;
440 font-weight: normal;
441 font-size: 1.125em;
442 padding: 0.25rem;
443 color: $notification-close-color;
444 cursor: pointer;
445 }
446 &-close:hover {
447 color: $notification-close-hover-color;
448 font-weight: bold;
449 }
450 &-content-action a {
451 color: $notification-content-action-color;
452 text-decoration: underline;
453 font-weight: bold;
454 }
455 }
456
457 .shiny-file-input {
458 &-active {
459 box-shadow: $shiny-file-active-shadow;
460 }
461 &-over {
462 box-shadow: $shiny-file-over-shadow;
463 }
464 }
465
466 // Add spacing between icon and label for action buttons and links (#4348)
467 // Using margin instead of padding so the underline doesn't extend into the gap for links
468 .action-button {
469 .action-icon + .action-label {
470 margin-left: 1ch;
471 }
472 }
473
474 /* Overrides bootstrap-datepicker3.css styling for invalid date ranges.
475 See https://github.com/rstudio/shiny/issues/2042 for details. */
476 .datepicker table tbody tr td.disabled,
477 .datepicker table tbody tr td.disabled:hover,
478 .datepicker table tbody tr td span.disabled,
479 .datepicker table tbody tr td span.disabled:hover {
480 color: $datepicker-disabled-color;
481 cursor: not-allowed;
482 }
483
484 // Selectize's remove_button plugin has a bug that can lead to multiple remove
485 // buttons being displayed when options get updated. This prevents that from
486 // happening (see #4274 for reprex)
487 .shiny-input-select .selectize-input > .item > .remove:not(:first-child) {
488 display: none;
489 }
490
491 /* Hidden tabPanels */
492 .nav-hidden {
493 /* override anything bootstrap sets for `.nav` */
494 display: none !important;
495 }