app.css 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* =====================================================================
  2. codegraph ui — the app's global primitives
  3. The design tokens themselves live in `lib/theme.css`, which is also
  4. what `@colbymchenry/codegraph-ui` exports for a host to import and
  5. override. This file is everything ON TOP of them that only the
  6. standalone viewer needs: the reset, the shell grid, and the handful of
  7. primitives shared across views.
  8. Component-specific rules live in each .svelte file's scoped <style>.
  9. ===================================================================== */
  10. @import './lib/theme.css';
  11. /* ---------- reset ---------- */
  12. html,
  13. body {
  14. height: 100%;
  15. }
  16. body {
  17. margin: 0;
  18. /* body always paints --paper: the bars are transparent over it and a
  19. short view must not reveal the browser's own canvas colour. */
  20. background: var(--paper);
  21. color: var(--ink);
  22. font-family: var(--sans);
  23. font-size: 13px;
  24. line-height: 1.45;
  25. -webkit-font-smoothing: antialiased;
  26. }
  27. *,
  28. *::before,
  29. *::after {
  30. box-sizing: border-box;
  31. /* Square corners are non-negotiable in this system, including on the
  32. UA-styled controls (input, select, button) we do not restyle. */
  33. border-radius: 0 !important;
  34. }
  35. a {
  36. color: inherit;
  37. text-decoration: none;
  38. }
  39. button {
  40. font: inherit;
  41. color: inherit;
  42. background: none;
  43. border: 0;
  44. padding: 0;
  45. cursor: pointer;
  46. }
  47. h1,
  48. h2,
  49. h3 {
  50. font-weight: 600;
  51. text-wrap: balance;
  52. }
  53. :focus-visible {
  54. outline: 2px solid var(--accent);
  55. outline-offset: 1px;
  56. }
  57. @media (prefers-reduced-motion: reduce) {
  58. *,
  59. *::before,
  60. *::after {
  61. transition: none !important;
  62. animation: none !important;
  63. scroll-behavior: auto !important;
  64. }
  65. }
  66. /* ---------- app shell ----------
  67. Design spec §3.1: top bar 48px / trail bar 34px / main. The grid is on
  68. index.html's mount host, which App.svelte fills directly (no wrapper — a
  69. second #app would duplicate the id).
  70. The trail row is `auto`, not `--trailbar-h`: the bar keeps that height on
  71. its own (see TrailBar.svelte) and grows only while the save-trail form is
  72. open. Pinning the row instead would clip the form. */
  73. #app {
  74. height: 100vh;
  75. display: grid;
  76. grid-template-rows: var(--topbar-h) auto 1fr;
  77. }
  78. /* ---------- cross-view primitives ---------- */
  79. .mono {
  80. font-family: var(--mono);
  81. }
  82. .dim {
  83. color: var(--ink-3);
  84. }
  85. .tnum {
  86. font-variant-numeric: tabular-nums;
  87. }
  88. /* Empty / not-yet-loaded states. Sentence case, no exclamation marks —
  89. say what is missing and what to do about it. */
  90. .emptystate {
  91. padding: 40px;
  92. max-width: 60ch;
  93. color: var(--ink-2);
  94. line-height: 1.5;
  95. }
  96. .emptystate h2 {
  97. margin: 0 0 8px;
  98. font-size: 16px;
  99. color: var(--ink);
  100. }
  101. .emptystate p {
  102. margin: 0 0 10px;
  103. }
  104. .emptystate code {
  105. font-family: var(--mono);
  106. font-size: 12px;
  107. background: var(--press);
  108. padding: 1px 4px;
  109. }