File size: 10,400 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
// Directly's Real Time Messaging (RTM) widget is an on-demand customer support tool.
// Read more about the RTM widget and how it's used in Calypso in the `lib/directly` README.
//
// The RTM widget loads in an iframe, so we can't adjust the widget's internal styles
// with the primary Calypso stylesheet. This file is bundled as a separate CSS file to be
// linked from inside the widget's iframe.
//
// We have two Directly builds — Production and Sandbox. Directly requires that all
// custom CSS files exist at a public web address, and these can't change on-the-fly
// based on the Calypso environment. So the CSS files Directly uses are hard-set to:
//
// Sandbox: https://wpcalypso.wordpress.com/calypso/directly.css
// Production: https://wordpress.com/calypso/directly.css
//
// ## DEVELOPMENT ENVIRONMENT INSTRUCTIONS:
//
// Calypso's development environment uses the Sandbox Directly build, which requests custom
// CSS from the wpcalypso server. This means that to see local CSS changes you'll need to
// make your browser rewrite those CSS URLs to the local version:
//
// https://wpcalypso.wordpress.com/calypso/directly.css -> http://calypso.localhost:3000/calypso/directly.css
//
// You can accomplish this using a browser extension such as Switcharoo Redirector
// for Chrome: https://chrome.google.com/webstore/detail/switcheroo-redirector/cnmciclhnghalnpfhhleggldniplelbg
//
// An unfortunate side-effect is that the widget's iframe src is https, but this local
// CSS file is http. So most browsers will block the CSS by default to prevent mixed
// content. In order to see the custom CSS you will need to temporarily allow insecure
// content on the page. In Chrome for Mac you can issue this Terminal command:
//
// open -a Google\ Chrome --args --allow-running-insecure-content
//
// QUIT AND RESTART YOUR BROWSER NORMALLY WHEN YOU'RE DONE MAKING LOCAL CSS CHANGES.
@import "shared/utils";
* {
font-family: $sans;
}
body {
color: var(--color-text);
-webkit-font-smoothing: subpixel-antialiased;
}
html,
input,
select,
textarea {
font-family: $sans;
}
// Main button
.btn {
background: var(--color-primary);
border: 1px solid var(--color-primary-40);
color: var(--color-text-inverted);
border-width: 1px 1px 2px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
vertical-align: top;
box-sizing: border-box;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
appearance: none;
width: auto;
&:hover {
border-color: var(--color-primary-dark);
}
&:active,
&:active:enabled {
outline: 0;
border-width: 2px 1px 1px;
padding: 7px 14px 9px;
color: var(--color-text-inverted);
}
&:focus {
border-color: var(--color-primary-dark);
box-shadow: 0 0 0 2px var(--color-primary-light);
}
}
// Form inputs
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea {
@extend %form-field;
-webkit-font-smoothing: subpixel-antialiased;
&::-webkit-input-placeholder {
color: var(--color-neutral-light);
}
}
textarea {
vertical-align: inherit;
}
.minimized-view,
.maximized-view {
background: #f2f6f8;
}
.minimized-view {
background: var(--color-surface);
box-shadow: 0 1px 10px rgba(46, 68, 83, 0.1);
border: 1px solid var(--color-neutral-5);
}
.maximized-view.is-ask-view {
top: 0;
}
.message-list-transition-wrapper {
background: #f2f6f8;
}
/* HEADER */
.header-container {
border-bottom: 1px solid var(--color-neutral-0);
box-shadow: none;
flex: 0 0 32px;
height: 32px;
.header-title {
text-transform: uppercase;
font-size: 11px;
font-weight: 700;
color: var(--color-neutral-light);
}
// Left hamburger button
.menu {
border-right: none;
flex: 0 0 40px;
.svg-icon {
color: var(--color-neutral-light);
}
&.disabled {
background: transparent;
.svg-icon {
color: var(--color-neutral-5);
}
}
}
// Right minimize button
.minimize-container {
border-left: none;
flex: 0 0 40px;
.svg-icon {
color: var(--color-neutral-light);
}
}
.thread-view-title-container {
&.has-notification {
border-bottom-color: #14abdd;
}
}
}
/* CHAT LIST (opens with the hamburguer button on header) */
.chat-list-view-container {
.chat-list-container {
top: 32px;
.question-bar,
.question-bar.closed {
background: var(--color-neutral-light);
padding: 10px 14px;
}
}
}
.chat-list-view-item-container {
background: var(--color-neutral-0);
border-bottom: 1px solid var(--color-neutral-5);
color: var(--color-text);
padding: 18px 10px 18px 24px;
.chat-list-item-title {
margin-bottom: 2px;
font-size: 16px;
}
.chat-list-item-meta {
color: var(--color-neutral-light);
}
.unread-message-dot {
background: var(--color-success);
left: 10px;
top: 25px;
}
}
// Bubble when the chat list is minimized
.chat-list-view-minimized {
.chat-list-status {
margin-top: 2px;
}
.svg-icon {
color: var(--color-primary);
}
}
/* ASK QUESTION (opens from chat list) */
.ask-question-form-container {
.input-group {
padding-bottom: 12px;
margin-top: 0;
label {
text-transform: none;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
strong {
font-weight: inherit;
}
}
}
.submit {
width: 100%;
padding-bottom: 9px;
.svg-icon {
display: none;
}
strong {
margin-top: 0;
font-weight: 500;
}
}
}
/* THREAD */
.thread-view-container {
.expert-response-time {
color: var(--color-neutral-light);
}
}
// Message bubbles
.message-container {
font-size: 14px;
border-radius: 8px; /* stylelint-disable-line scales/radii */
&.is-poster {
background: #14abdd;
margin-left: inherit;
margin-right: 20px;
border-top-right-radius: 0;
position: relative;
&::after {
// Triangle for the corner
position: absolute;
top: 0;
right: -10px;
content: "";
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 10px 10px 0 0;
border-color: #14abdd transparent transparent;
}
}
&.is-expert {
border: none;
border-radius: 8px; /* stylelint-disable-line scales/radii */
border-top-left-radius: 0;
margin-right: inherit;
margin-left: 20px;
position: relative;
&::after {
// Triangle for the corner
position: absolute;
top: 0;
left: -10px;
content: "";
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 0 10px 10px 0;
border-color: transparent var(--color-border-inverted) transparent transparent;
}
.author img {
// Need to override inline styles with !importants
width: 32px !important;
height: 32px !important;
}
}
}
// Avatar + name + reputation, used inside .message-container.is-expert
.author {
.name-wrapper {
font-size: 12px;
font-weight: 500;
}
.profile .reputation {
color: var(--color-neutral-20);
}
}
.avatar {
background: var(--color-neutral-5);
}
.system-message {
border: 1px solid var(--color-neutral-5);
background: var(--color-neutral-0);
font-size: 14px;
margin-right: 0;
border-radius: 8px; /* stylelint-disable-line scales/radii */
&.has-sibling + .system-message {
border-top: 1px solid var(--color-neutral-5);
}
// Green border for success messages
&.success {
border-color: var(--color-success);
background: #dceee5;
}
// Green background for highlighted success messages
&.success.inverted {
border-color: transparent;
background: var(--color-success);
color: var(--color-text-inverted);
a {
color: var(--color-text-inverted);
}
}
// Yellow borders for warnings
&.warning {
background: var(--color-warning);
border-color: transparent;
color: var(--color-text-inverted);
a {
color: var(--color-text-inverted);
}
}
// Placeholder displayed when the experts info is loading
&.alerting-experts {
.expert-name:empty {
background: var(--color-neutral-5);
}
.expert-last-active-date {
color: var(--color-neutral-light);
&:empty {
background: var(--color-neutral-5);
}
}
}
.icon-avatar {
background: var(--color-neutral-5);
}
// Icons inside system messages
.icon {
margin-top: 0;
&.icon-primary {
background-color: #14abdd;
}
&.icon-success {
background-color: var(--color-surface);
color: var(--color-success);
}
&.icon-warning {
background-color: var(--color-surface);
color: var(--color-warning);
}
}
&.inverted .icon.icon-success {
background-color: var(--color-surface);
color: var(--color-success);
}
}
// When nobody has answered a question yet, a carousel of last available experts is shown
.expert-carousel {
box-shadow: none;
}
// Reply box and other tools in the thread view footer
.thread-view-footer {
border-top: 1px solid var(--color-neutral-0);
box-shadow: none;
background: var(--color-surface);
}
// Bubble when the thread view is minimized
.chat-view-minimized {
// When no expert has replied yet
.alerting {
color: var(--color-neutral-light);
.beacon {
background: var(--color-primary);
margin: 5px auto;
&::after {
background: var(--color-primary);
}
}
}
// When there's a chat going on
.chatting img {
height: 64px;
width: 64px;
}
.notification {
background: var(--color-primary);
font-size: 12px;
font-weight: 500;
min-width: 24px;
line-height: 24px;
margin-top: -3px;
margin-left: -3px;
}
}
// Chat box
.message-form-container {
.message-input {
padding-right: 10px;
align-self: center;
}
textarea:focus {
box-shadow: none;
}
.submit-btn[disabled] {
background-color: var(--color-neutral-5);
border: none;
}
}
// Tools inside chat box
.toolbar-accepted-container,
.toolbar-default-container,
.toolbar-rate-container {
border-top: 1px solid var(--color-neutral-0);
}
.toolbar-container {
.tooltip-wrapper {
border-left: 1px solid var(--color-neutral-0);
}
.toolbar-btn {
color: var(--color-neutral-light);
border-left: 1px solid var(--color-neutral-0);
.svg-icon {
color: var(--color-success);
}
}
.rate-icon {
.dot {
&.dot-green {
background: var(--color-success);
}
&.dot-yellow {
background: var(--color-warning);
}
&.dot-red {
background: var(--color-error);
}
}
}
}
// Displays when the user wants to accept the answer
.ActionBar {
background: var(--color-surface);
}
.ActionBar__button {
box-shadow: none;
&:hover {
box-shadow: none;
transform: none;
}
}
|