Popup.css (6008B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 .preview-popup { 6 border: 1px solid var(--theme-splitter-color); 7 height: auto; 8 overflow: auto; 9 background: var(--theme-body-background); 10 box-shadow: 1px 1px 3px var(--popup-shadow-color); 11 } 12 13 /* Popover is used when previewing objects */ 14 .popover .preview-popup { 15 max-width: 450px; 16 min-width: 200px; 17 18 &.preview-type-pause { 19 padding: 5px 10px; 20 } 21 22 /* Because of tracer header, we can't put a padding on the popup */ 23 /* Nor can we put a margin on the .tree or .objectBox which causes overflows */ 24 &.preview-type-tracer { 25 overflow: hidden; 26 display: flex; 27 flex-direction: column; 28 .tree { 29 padding: 5px; 30 overflow: auto; 31 flex: 1; 32 } 33 } 34 } 35 36 /* Tooltip is used when previewing primitives and exceptions */ 37 .tooltip .preview-popup { 38 max-width: inherit; 39 min-height: inherit; 40 max-height: 200px; 41 42 &.preview-type-pause { 43 padding: 5px; 44 } 45 46 &.preview-type-tracer { 47 padding-bottom: 5px; 48 49 .preview-tracer-header { 50 margin-bottom: 5px; 51 } 52 .objectBox { 53 padding: 0 5px; 54 } 55 } 56 57 &.exception-popup { 58 padding: 5px; 59 color: var(--theme-error-color); 60 background-color: var(--theme-error-background); 61 } 62 } 63 64 .preview-tracer-header { 65 --icon-url: url("chrome://devtools/content/debugger/images/trace.svg"); 66 --icon-color: var(--theme-inline-preview-label-trace-color); 67 color: var(--theme-inline-preview-label-trace-color); 68 background-color: var(--theme-inline-preview-label-trace-background); 69 border-block-end: 1px solid oklch(from var(--theme-inline-preview-label-trace-color) l c h / 0.25); 70 71 /* Add a bit more padding on the end to balance the icon, especially when have a small primitive value in preview */ 72 padding-inline-end: 10px !important; 73 } 74 75 .preview-tracer-warning { 76 --icon-url: url("chrome://devtools/skin/images/info.svg"); 77 --icon-color: currentColor; 78 background-color: var(--theme-body-alternate-emphasized-background); 79 border-bottom: 1px solid var(--theme-splitter-color); 80 } 81 82 .preview-tracer-header, 83 .preview-tracer-warning { 84 display: flex; 85 gap: 5px; 86 padding: 5px; 87 align-items: center; 88 89 &::before { 90 flex-shrink: 0; 91 content: ""; 92 display: inline-block; 93 width: 12px; 94 height: 12px; 95 96 background-image: var(--icon-url); 97 background-size: contain; 98 background-repeat: no-repeat; 99 background-position: center; 100 101 -moz-context-properties: fill; 102 fill: var(--icon-color); 103 } 104 } 105 106 .preview-popup .tree { 107 /* Setting a fixed line height to avoid issues in custom formatters changing 108 * the line height like the CLJS DevTools */ 109 line-height: 15px; 110 } 111 112 .gap svg { 113 pointer-events: none; 114 } 115 116 .gap polygon { 117 pointer-events: auto; 118 } 119 120 .popover .preview-popup .object-node { 121 padding-inline-start: 0; 122 } 123 124 .preview-token:hover { 125 cursor: default; 126 } 127 128 /** 129 * Use an animation in order to delay the preview-loading-token 130 * style 1/4s second after hovering a token. 131 * 132 * It avoids to render this intermediate style if the previews is ready 133 * right away. 134 */ 135 @keyframes animateLoading { 136 25% { 137 cursor: wait; 138 text-decoration: grey underline solid; 139 text-decoration-thickness: 2px; 140 text-underline-offset: 2px; 141 text-decoration-skip-ink: none; 142 } 143 100% { 144 cursor: wait; 145 text-decoration: grey underline solid; 146 text-decoration-thickness: 2px; 147 text-underline-offset: 2px; 148 text-decoration-skip-ink: none; 149 } 150 } 151 .preview-loading-token { 152 animation: animateLoading 1s forwards; 153 } 154 155 .preview-token, 156 .debug-expression.preview-token { 157 background-color: var(--theme-highlight-yellow); 158 } 159 160 .theme-dark .preview-token, 161 .theme-dark .debug-expression.preview-token { 162 background-color: #743884; 163 } 164 165 .theme-dark .cm-s-mozilla .preview-token, 166 .theme-dark .cm-s-mozilla .debug-expression.preview-token { 167 color: #e7ebee; 168 } 169 170 /* Use a color other than yellow to highlight the hovered token on the paused line 171 as the paused line is already yellow */ 172 .paused-line .preview-token { 173 background-color: light-dark(rgba(202, 227, 255, 0.5), rgba(202, 227, 255, 0.3)); 174 } 175 176 /* This rule only make sure the text remains readable when hovering a token on the paused line. */ 177 :root[forced-colors-active] .paused-line :is(.preview-token, .debug-expression.preview-token) { 178 color: inherit; 179 background-color: inherit; 180 } 181 182 .theme-dark .popover .preview-popup { 183 border-color: var(--theme-body-color); 184 } 185 186 .tooltip { 187 position: fixed; 188 z-index: 100; 189 } 190 191 .theme-dark .tooltip .preview-popup { 192 border-color: var(--theme-body-color); 193 } 194 195 .tooltip .gap { 196 height: 4px; 197 padding-top: 0; 198 } 199 200 /* Exception popup */ 201 .exception-popup .exception-text { 202 color: var(--red-70); 203 } 204 205 .theme-dark .exception-popup .exception-text { 206 color: var(--red-20); 207 } 208 209 .exception-popup .exception-message { 210 display: flex; 211 align-items: center; 212 } 213 214 .exception-message .dbg-img-arrow { 215 margin-inline-end: 4px; 216 } 217 218 .exception-popup .exception-stacktrace { 219 display: grid; 220 grid-template-columns: auto 1fr; 221 grid-column-gap: 8px; 222 padding-inline: 20px 3px; 223 line-height: var(--theme-code-line-height); 224 } 225 226 .exception-stacktrace .frame { 227 display: contents; 228 cursor: pointer; 229 } 230 231 .exception-stacktrace .title { 232 grid-column: 1/2; 233 color: var(--grey-90); 234 } 235 236 .theme-dark .exception-stacktrace .title { 237 color: white; 238 } 239 240 .exception-stacktrace .location { 241 grid-column: -1/-2; 242 color: var(--theme-highlight-purple); 243 direction: rtl; 244 text-align: end; 245 white-space: nowrap; 246 /* Force the location to be on one line and crop at start if wider then max-width */ 247 overflow: hidden; 248 text-overflow: ellipsis; 249 max-width: 350px; 250 } 251 252 .theme-dark .exception-stacktrace .location { 253 color: var(--blue-40); 254 } 255 256 .exception-stacktrace .line { 257 color: var(--theme-highlight-blue); 258 } 259 260 .theme-dark .exception-stacktrace .line { 261 color: hsl(210, 40%, 60%); 262 }