1// Copyright (C) 2018 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15@import "widgets/theme"; 16@import "typefaces"; 17@import "fonts"; 18 19:root { 20 --sidebar-width: 230px; 21 --topbar-height: 44px; 22 --monospace-font: "Roboto Mono", monospace; 23 --track-shell-width: 250px; 24 --track-border-color: #00000025; 25 --anim-easing: cubic-bezier(0.4, 0, 0.2, 1); 26 --selection-stroke-color: #00344596; 27 --selection-fill-color: #8398e64d; 28 --overview-timeline-non-visible-color: #c8c8c8cc; 29 --details-content-height: 280px; 30} 31 32@mixin transition($time: 0.1s) { 33 transition: opacity $time ease, color $time ease, background-color $time ease, 34 border-color $time ease, width $time ease, height $time ease, 35 max-width $time ease, max-height $time ease, margin $time ease, 36 transform $time ease, box-shadow $time ease, border-radius $time ease; 37} 38 39@mixin material-icon($content) { 40 @include icon; 41 content: $content; 42} 43 44@mixin track_shell_title() { 45 font-size: 14px; 46 max-height: 30px; 47 overflow: hidden; 48 text-align: left; 49 overflow-wrap: break-word; 50 font-family: "Roboto Condensed", sans-serif; 51 font-weight: 300; 52 line-break: anywhere; 53} 54 55* { 56 box-sizing: border-box; 57 -webkit-tap-highlight-color: transparent; 58 touch-action: none; 59} 60 61html { 62 font-family: Roboto, verdana, sans-serif; 63 height: 100%; 64 width: 100%; 65} 66 67html, 68body, 69body > main { 70 height: 100%; 71 width: 100%; 72 padding: 0; 73 margin: 0; 74 overscroll-behavior: none; 75 overflow: hidden; 76} 77 78pre, 79code { 80 font-family: var(--monospace-font); 81} 82 83// This is to minimize Mac vs Linux Chrome Headless rendering differences 84// when running UI intergrationtests via puppeteer. 85body.testing { 86 -webkit-font-smoothing: antialiased !important; 87 font-kerning: none !important; 88} 89 90h1, 91h2, 92h3 { 93 font-family: inherit; 94 font-size: inherit; 95 font-weight: inherit; 96 padding: 0; 97 margin: 0; 98} 99table { 100 user-select: text; 101} 102 103body > main { 104 display: grid; 105 grid-template-areas: 106 "sidebar topbar" 107 "sidebar alerts" 108 "sidebar page"; 109 grid-template-rows: auto auto 1fr; 110 grid-template-columns: auto 1fr; 111 color: #121212; 112 overflow: hidden; 113} 114 115body.filedrag::after { 116 content: "Drop the trace file to open it"; 117 position: fixed; 118 z-index: 99; 119 top: 0; 120 left: 0; 121 right: 0; 122 bottom: 0; 123 border: 10px dashed #404854; 124 text-align: center; 125 font-size: 3rem; 126 line-height: 100vh; 127 color: #333; 128 background: rgba(255, 255, 255, 0.5); 129} 130 131button { 132 background: none; 133 color: inherit; 134 border: none; 135 padding: 0; 136 font: inherit; 137 cursor: pointer; 138 outline: inherit; 139} 140 141button.close { 142 font-family: var(--monospace-font); 143} 144 145.full-page-loading-screen { 146 position: absolute; 147 width: 100%; 148 height: 100%; 149 display: flex; 150 justify-content: center; 151 align-items: center; 152 flex-direction: row; 153 background: #3e4a5a url("assets/logo-3d.png") no-repeat fixed center; 154} 155 156.page { 157 grid-area: page; 158 position: relative; 159 display: flex; 160 flex-direction: column; 161 overflow: hidden; 162} 163 164.split-panel { 165 flex: 1; 166 display: flex; 167 flex-flow: row; 168 position: relative; 169 overflow: hidden; 170} 171 172.alerts { 173 grid-area: alerts; 174 background-color: #f2f2f2; 175 > div { 176 font-family: "Roboto", sans-serif; 177 font-weight: 400; 178 letter-spacing: 0.25px; 179 padding: 1rem; 180 display: flex; 181 justify-content: space-between; 182 align-items: center; 183 button { 184 width: 24px; 185 height: 24px; 186 } 187 } 188} 189 190.query-table-container { 191 width: 100%; 192} 193 194@mixin table-font-size { 195 font-size: 14px; 196 line-height: 18px; 197} 198 199$table-hover-color: hsl(214, 22%, 90%); 200 201$table-border-color: rgba(60, 76, 92, 0.4); 202 203$bottom-tab-padding: 10px; 204 205@mixin table-component { 206 @include bottom-panel-font; 207 @include table-font-size; 208 209 width: 100%; 210 border-collapse: collapse; 211 212 thead { 213 font-weight: normal; 214 } 215 216 tr:hover td { 217 background-color: $table-hover-color; 218 } 219 220 tr.header { 221 border-bottom: 1px solid $table-border-color; 222 text-align: center; 223 } 224 225 td { 226 padding: 2px 1px; 227 228 i.material-icons { 229 // Shrink the icons inside the table cells to increase the information 230 // density a little bit. 231 font-size: 16px; 232 } 233 } 234} 235 236.generic-table { 237 @include table-component; 238} 239 240.pivot-table { 241 @include table-component; 242 243 thead, 244 i { 245 cursor: pointer; 246 } 247 td.first { 248 border-left: 1px solid $table-border-color; 249 padding-left: 6px; 250 } 251 thead td.reorderable-cell { 252 cursor: grab; 253 } 254 .disabled { 255 cursor: default; 256 } 257 .indent { 258 display: inline-block; 259 // 16px is the width of expand_more/expand_less icon to pad out cells 260 // without the button 261 width: 16px; 262 } 263 strong { 264 font-weight: 400; 265 } 266} 267 268.query-table { 269 width: 100%; 270 font-size: 14px; 271 border: 0; 272 thead td { 273 position: sticky; 274 top: 0; 275 background-color: hsl(214, 22%, 90%); 276 color: #262f3c; 277 text-align: center; 278 padding: 1px 3px; 279 border-style: solid; 280 border-color: #fff; 281 border-right-width: 1px; 282 border-left-width: 1px; 283 } 284 tbody tr { 285 @include transition(); 286 background-color: hsl(214, 22%, 100%); 287 font-family: var(--monospace-font); 288 &:nth-child(even) { 289 background-color: hsl(214, 22%, 95%); 290 } 291 td:first-child { 292 padding-left: 5px; 293 } 294 td:last-child { 295 padding-right: 5px; 296 } 297 &:hover { 298 background-color: hsl(214, 22%, 90%); 299 } 300 &[clickable] { 301 cursor: pointer; 302 } 303 } 304} 305 306.query-error { 307 padding: 20px 10px; 308 color: hsl(-10, 50%, 50%); 309 font-family: "Roboto Condensed", sans-serif; 310 font-weight: 300; 311} 312 313.dropdown { 314 display: inline-block; 315 position: relative; 316} 317 318.dropdown-button { 319 cursor: pointer; 320} 321 322.popup-menu { 323 position: absolute; 324 background-color: white; 325 right: 0; 326 box-shadow: 0 0 4px 0 #999; 327 /* TODO(hjd): Reduce and make z-index use sensible. */ 328 z-index: 1000; 329 330 &.closed { 331 display: none; 332 } 333 334 &.opened { 335 display: block; 336 } 337 338 button.open-menu { 339 border-radius: 0; 340 margin: 0; 341 height: auto; 342 background: transparent; 343 color: #111; 344 font-size: 12px; 345 padding: 0.4em 1em; 346 white-space: nowrap; 347 width: 100%; 348 text-align: right; 349 line-height: 1; 350 display: block; // Required in order for inherited white-space property not 351 // to screw up vertical rendering of the popup menu items. 352 353 &:hover { 354 background: #c7d0db; 355 } 356 } 357 358 .nested-menu { 359 padding-right: 1em; 360 } 361} 362 363.track { 364 display: grid; 365 grid-template-columns: auto 1fr; 366 grid-template-rows: 1fr 0; 367 368 &::after { 369 display: block; 370 content: ""; 371 grid-column: 1 / span 2; 372 border-top: 1px solid var(--track-border-color); 373 margin-top: -1px; 374 z-index: 2; 375 } 376 377 .track-shell { 378 @include transition(); 379 padding-left: 10px; 380 display: grid; 381 cursor: grab; 382 grid-template-areas: "title buttons"; 383 grid-template-columns: 1fr auto; 384 align-items: center; 385 width: var(--track-shell-width); 386 background: #fff; 387 border-right: 1px solid #c7d0db; 388 overflow: hidden; 389 390 &.drag { 391 background-color: #eee; 392 box-shadow: 0 4px 12px -4px #999 inset; 393 } 394 &.drop-before { 395 box-shadow: 0 4px 2px -1px hsl(213, 40%, 50%) inset; 396 } 397 &.drop-after { 398 box-shadow: 0 -4px 2px -1px hsl(213, 40%, 50%) inset; 399 } 400 401 &.selected { 402 background-color: #ebeef9; 403 } 404 405 &.alternating-thread-track { 406 background: hsl(214, 22%, 95%); 407 } 408 409 .chip { 410 background-color: #bed6ff; 411 border-radius: $pf-border-radius; 412 font-size: smaller; 413 padding: 0 0.1rem; 414 margin-left: 1ch; 415 } 416 417 h1 { 418 grid-area: title; 419 color: hsl(213, 22%, 30%); 420 @include track_shell_title(); 421 } 422 .track-buttons { 423 grid-area: buttons; 424 display: flex; 425 height: 100%; 426 align-items: center; 427 } 428 .track-button { 429 @include transition(); 430 color: rgb(60, 86, 136); 431 cursor: pointer; 432 width: 22px; 433 font-size: 18px; 434 opacity: 0; 435 } 436 437 .track-button.show { 438 opacity: 1; 439 } 440 .track-button.full-height { 441 display: flex; 442 height: 100%; 443 align-items: center; 444 justify-content: center; 445 446 &:hover { 447 background-color: #ebeef9; 448 } 449 } 450 451 &:hover .track-button { 452 opacity: 1; 453 } 454 &.flash { 455 background-color: #ffe263; 456 } 457 } 458} 459 460.scrolling-panel-container { 461 position: relative; 462 overflow-x: hidden; 463 overflow-y: scroll; // Always show vertical scrollbar 464 flex: 1 1 auto; 465 will-change: transform; // Force layer creation. 466 display: grid; 467 grid-template-columns: 1fr; 468 grid-template-rows: 1fr; 469 grid-template-areas: "space"; 470} 471 472.details-panel-container { 473 box-shadow: #0000003b 0px 0px 3px 1px; 474 position: relative; 475 overflow-x: hidden; 476 overflow-y: auto; 477 flex: 1 1 auto; 478 // TODO(hjd): This causes the sticky header to flicker when scrolling. 479 // Is will-change necessary in the details panel? 480 // will-change: transform; 481 display: grid; 482 grid-template-columns: 1fr; 483 grid-template-rows: 1fr; 484 grid-template-areas: "space"; 485} 486 487.pinned-panel-container { 488 position: relative; 489 // Override top level overflow: hidden so height of this flex item can be 490 // its content height. 491 overflow: visible; 492 box-shadow: 1px 3px 15px rgba(23, 32, 44, 0.3); 493 z-index: 2; 494 display: grid; 495 grid-template-columns: 1fr; 496 grid-template-rows: 1fr; 497 grid-template-areas: "space"; 498} 499 500// In the scrolling case, since the canvas is overdrawn and continuously 501// repositioned, we need the canvas to be in a div with overflow hidden and 502// height equaling the total height of the content to prevent scrolling 503// height from growing. 504.scroll-limiter { 505 position: relative; 506 grid-area: space; 507 overflow: hidden; 508} 509 510canvas.main-canvas { 511 z-index: -1; 512} 513 514.panels { 515 grid-area: space; 516 user-select: none; 517} 518 519.panel { 520 position: relative; // Otherwise canvas covers panel dom. 521 522 &.sticky { 523 position: sticky; 524 z-index: 3; 525 top: 0; 526 background-color: hsl(215, 22%, 19%); 527 } 528} 529 530.pan-and-zoom-content { 531 flex: 1; 532 position: relative; 533 display: flex; 534 flex-flow: column nowrap; 535} 536 537.overview-timeline { 538 height: 70px; 539} 540 541.time-axis-panel { 542 height: 12px; 543} 544 545.tickbar { 546 height: 5px; 547} 548 549.notes-panel { 550 height: 20px; 551} 552 553.x-scrollable { 554 overflow-x: auto; 555} 556 557header.overview { 558 display: flex; 559 align-content: baseline; 560 background-color: hsl(213, 22%, 82%); 561 color: hsl(213, 22%, 20%); 562 font-family: "Roboto Condensed", sans-serif; 563 font-size: 15px; 564 font-weight: 400; 565 padding: 4px 10px; 566 vertical-align: middle; 567 border-color: hsl(213, 22%, 75%); 568 border-style: solid; 569 border-width: 1px 0; 570 .code { 571 font-family: var(--monospace-font); 572 font-size: 12px; 573 margin-left: 10px; 574 color: hsl(213, 22%, 40%); 575 } 576 span { 577 white-space: nowrap; 578 } 579 span.code { 580 text-overflow: ellipsis; 581 max-width: 50vw; 582 overflow: hidden; 583 } 584 span.spacer { 585 flex-grow: 1; 586 } 587} 588 589.text-select { 590 user-select: text; 591} 592 593button.query-ctrl { 594 background: #262f3c; 595 color: white; 596 border-radius: 10px; 597 font-size: 10px; 598 height: 18px; 599 line-height: 18px; 600 min-width: 7em; 601 margin: auto 0 auto 1rem; 602} 603 604.debug-panel-border { 605 position: absolute; 606 top: 0; 607 height: 100%; 608 width: 100%; 609 border: 1px solid rgba(69, 187, 73, 0.5); 610 pointer-events: none; 611} 612 613.perf-stats { 614 --stroke-color: hsl(217, 39%, 94%); 615 position: fixed; 616 bottom: 0; 617 left: 0; 618 width: 600px; 619 color: var(--stroke-color); 620 font-family: var(--monospace-font); 621 padding: 10px 24px; 622 z-index: 100; 623 background-color: rgba(27, 28, 29, 0.9); 624 button { 625 text-decoration: underline; 626 color: hsl(45, 100%, 48%); 627 &:hover { 628 color: hsl(6, 70%, 53%); 629 } 630 } 631 .close-button { 632 position: absolute; 633 right: 20px; 634 top: 10px; 635 width: 20px; 636 height: 20px; 637 color: var(--stroke-color); 638 } 639 & > section { 640 padding: 5px; 641 border-bottom: 1px solid var(--stroke-color); 642 } 643 div { 644 margin: 2px 0; 645 } 646 table, 647 td, 648 th { 649 border: 1px solid var(--stroke-color); 650 text-align: center; 651 padding: 4px; 652 margin: 4px 0; 653 } 654 table { 655 border-collapse: collapse; 656 } 657} 658 659.track-group-panel { 660 --collapsed-background: hsla(190, 49%, 97%, 1); 661 --collapsed-transparent: hsla(190, 49%, 97%, 0); 662 --expanded-background: hsl(215, 22%, 19%); 663 --expanded-transparent: hsl(215, 22%, 19%, 0); 664 display: grid; 665 grid-template-columns: auto 1fr; 666 grid-template-rows: 1fr; 667 transition: background-color 0.4s, color 0.4s; 668 height: 40px; 669 &::after { 670 display: block; 671 content: ""; 672 grid-column: 1 / span 2; 673 border-top: 1px solid var(--track-border-color); 674 margin-top: -1px; 675 } 676 &[collapsed="true"] { 677 background-color: var(--collapsed-transparent); 678 .shell { 679 border-right: 1px solid #c7d0db; 680 background-color: var(--collapsed-background); 681 } 682 .track-button { 683 color: rgb(60, 86, 136); 684 } 685 } 686 &[collapsed="false"] { 687 background-color: var(--expanded-transparent); 688 color: white; 689 font-weight: bold; 690 .shell.flash { 691 color: #121212; 692 } 693 .track-button { 694 color: white; 695 } 696 span.chip { 697 color: #121212; 698 } 699 } 700 .shell { 701 padding: 4px 4px; 702 display: grid; 703 grid-template-areas: "fold-button title check"; 704 grid-template-columns: 28px 1fr 20px; 705 align-items: center; 706 line-height: 1; 707 width: var(--track-shell-width); 708 min-height: 40px; 709 transition: background-color 0.4s; 710 711 .track-title { 712 user-select: text; 713 } 714 715 .track-subtitle { 716 font-size: 0.6rem; 717 font-weight: normal; 718 overflow: hidden; 719 white-space: nowrap; 720 text-overflow: ellipsis; 721 // Maximum width according to grid-template-columns value for .shell 722 width: calc(var(--track-shell-width) - 56px); 723 } 724 725 .chip { 726 background-color: #bed6ff; 727 border-radius: 3px; 728 font-size: smaller; 729 padding: 0 0.1rem; 730 margin-left: 1ch; 731 } 732 733 .title-wrapper { 734 grid-area: title; 735 overflow: hidden; 736 } 737 h1 { 738 @include track_shell_title(); 739 } 740 .fold-button { 741 grid-area: fold-button; 742 } 743 .track-button { 744 font-size: 20px; 745 } 746 &:hover { 747 cursor: pointer; 748 .fold-button { 749 color: hsl(45, 100%, 48%); 750 } 751 } 752 &.flash { 753 background-color: #ffe263; 754 } 755 &.selected { 756 background-color: #ebeef9; 757 } 758 } 759 .track-content { 760 display: grid; 761 span { 762 @include track_shell_title(); 763 align-self: center; 764 } 765 } 766} 767 768.time-selection-panel { 769 height: 10px; 770} 771 772.cookie-consent { 773 position: absolute; 774 z-index: 10; 775 left: 10px; 776 bottom: 10px; 777 width: 550px; 778 background-color: #19212b; 779 font-size: 14px; 780 color: rgb(180, 183, 186); 781 border-radius: 5px; 782 padding: 20px; 783 784 .buttons { 785 display: flex; 786 justify-content: flex-end; 787 margin-top: 10px; 788 font-size: 15px; 789 } 790 791 button { 792 padding: 10px; 793 border-radius: 3px; 794 color: #fff; 795 margin-left: 5px; 796 a { 797 text-decoration: none; 798 color: #fff; 799 } 800 } 801 button:hover { 802 background-color: #373f4b; 803 cursor: pointer; 804 } 805} 806 807.disallow-selection { 808 user-select: none; 809} 810 811.pivot-table { 812 user-select: text; 813 padding: $bottom-tab-padding; 814 815 button.mode-button { 816 border-radius: 10px; 817 padding: 7px; 818 margin: 5px; 819 background-color: #c7d0db; 820 } 821 822 &.query-error { 823 color: red; 824 } 825 826 .total-values { 827 text-align: right; 828 padding-right: 10px; 829 } 830 831 .empty-result { 832 padding: 10px; 833 } 834 835 td.menu { 836 text-align: left; 837 } 838 839 td { 840 // In context menu icon to go on a separate line. 841 // In regular pivot table cells, avoids wrapping the icon spacer to go on 842 // a separate line. 843 white-space: pre; 844 } 845} 846 847.name-completion { 848 input { 849 width: 90%; 850 } 851 min-height: 20vh; 852 min-width: 30vw; 853 854 .arguments-popup-sizer { 855 color: transparent; 856 user-select: none; 857 height: 0; 858 } 859} 860 861.reorderable-cell { 862 &.dragged { 863 color: gray; 864 } 865 866 &.highlight-left { 867 background: linear-gradient(90deg, $table-border-color, transparent 20%); 868 } 869 870 &.highlight-right { 871 background: linear-gradient(270deg, $table-border-color, transparent 20%); 872 } 873} 874 875.history-item { 876 border-bottom: 1px solid hsl(213, 22%, 75%); 877 padding: 0.25em 0.5em; 878 max-height: 150px; 879 overflow-y: auto; 880 881 pre { 882 font-size: 10pt; 883 margin: 0; 884 overflow-x: auto; 885 } 886 887 &:hover .history-item-buttons { 888 visibility: visible; 889 } 890} 891 892.history-item-buttons { 893 position: sticky; 894 float: right; 895 top: 0; 896 visibility: hidden; 897 898 button { 899 margin: 0 0.5rem; 900 901 i.material-icons, 902 i.material-icons-filled { 903 font-size: 18px; 904 } 905 } 906} 907 908.context-wrapper { 909 white-space: nowrap; 910 911 i.material-icons { 912 margin-left: 0; 913 } 914} 915