ShtukbaseStandard
страница пакета→ /design/explore-kit/explore.css

pages/design/explore-kit/explore.css

163 строки, 9.5 КБ. Открыть как есть (в проекте рядом лежат другие файлы, здесь их может не быть).

Файл как есть в пакете: код и комментарии в нём не переводятся.

  1. /* explore-kit 0.1.1 - the control panel for exploration pages and lenses.
  2. * Styled only with the token contract v1 (shadcn names + Tailwind namespaces); the fallbacks after the comma
  3. * keep the panel readable on a page with no style installed. Everything is scoped under .xp. */
  4. .xp {
  5. /* On a lens page the kit's own variables come first: the kit uses --muted for grey text, --accent for its blue and
  6. * --card for a white tile, so the shadcn names mean something else there. Without the kit, the contract names apply. */
  7. --xp-bg: var(--panel, var(--popover, #fff));
  8. --xp-fg: var(--ink, var(--popover-foreground, #191919));
  9. --xp-muted: var(--bg3, var(--muted, #f1f1ef));
  10. --xp-muted-fg: var(--muted-foreground, var(--faint, #6b6a66));
  11. --xp-accent: var(--wash2, var(--accent, #e9e9e6));
  12. --xp-border: var(--line, var(--border, #e6e5e3));
  13. --xp-ring: var(--ring, #9b9a96);
  14. --xp-strong: var(--foreground, #191919);
  15. --xp-strong-fg: var(--background, #fff);
  16. --xp-radius: var(--radius, 10px);
  17. --xp-font: var(--font-sans, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
  18. --xp-mono: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
  19. --xp-shadow: var(--shadow-lg, 0 10px 30px -8px rgb(0 0 0 / .18), 0 2px 6px rgb(0 0 0 / .06));
  20. --xp-ease: var(--sb-ease, cubic-bezier(.2, .7, .2, 1));
  21. --xp-dur: var(--sb-dur, 160ms);
  22. --xp-w: 288px;
  23. position: fixed; top: 12px; right: 12px; z-index: 1000;
  24. font: 400 12px/1.35 var(--xp-font); color: var(--xp-fg);
  25. -webkit-font-smoothing: antialiased;
  26. }
  27. .xp *, .xp *::before, .xp *::after { box-sizing: border-box; }
  28. .xp button, .xp select, .xp input { font: inherit; color: inherit; margin: 0; }
  29. .xp :focus-visible { outline: 2px solid var(--xp-ring); outline-offset: 2px; }
  30. /* the small button of the collapsed state */
  31. .xp-open {
  32. display: none; width: 36px; height: 36px; padding: 9px; border: 0; cursor: pointer;
  33. border-radius: calc(var(--xp-radius) + 2px); background: var(--xp-bg); color: var(--xp-fg);
  34. box-shadow: var(--xp-shadow), 0 0 0 1px var(--xp-border);
  35. transition: transform var(--xp-dur) var(--xp-ease);
  36. }
  37. .xp-open:hover { transform: translateY(-1px); }
  38. .xp-open svg { width: 18px; height: 18px; display: block; }
  39. .xp-collapsed .xp-open { display: block; }
  40. /* the panel */
  41. .xp-panel {
  42. width: var(--xp-w); max-height: calc(100vh - 24px); display: flex; flex-direction: column;
  43. background: var(--xp-bg); border-radius: calc(var(--xp-radius) + 4px);
  44. box-shadow: var(--xp-shadow), 0 0 0 1px var(--xp-border);
  45. animation: xp-in var(--xp-dur) var(--xp-ease);
  46. }
  47. .xp-panel[hidden] { display: none; }
  48. @keyframes xp-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
  49. @media (prefers-reduced-motion: reduce) { .xp-panel { animation: none; } .xp-open { transition: none; } }
  50. .xp-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 16px; }
  51. .xp-title { flex: 1; font-weight: 600; font-size: 13px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  52. .xp-icon {
  53. width: 26px; height: 26px; padding: 5px; border: 0; border-radius: 7px; cursor: pointer;
  54. background: transparent; color: var(--xp-muted-fg);
  55. }
  56. .xp-icon:hover { background: var(--xp-muted); color: var(--xp-fg); }
  57. .xp-icon svg { width: 16px; height: 16px; display: block; }
  58. .xp-body { overflow: auto; padding: 0 16px 6px; overscroll-behavior: contain; }
  59. .xp-presetrow { padding: 2px 0 10px; border-bottom: 1px solid var(--xp-border); margin-bottom: 4px; }
  60. /* sections: small caps headers that fold */
  61. .xp-section + .xp-section { border-top: 1px solid var(--xp-border); }
  62. .xp-shead {
  63. display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 0 6px; border: 0; background: none; cursor: pointer;
  64. font-weight: 600; font-size: 10px; line-height: 1; letter-spacing: .07em; text-transform: uppercase; color: var(--xp-muted-fg); text-align: left;
  65. }
  66. .xp-shead span { flex: 1; }
  67. .xp-shead svg { width: 10px; height: 10px; transition: transform var(--xp-dur) var(--xp-ease); }
  68. .xp-shead:hover { color: var(--xp-fg); }
  69. .xp-folded .xp-shead svg { transform: rotate(-90deg); }
  70. .xp-folded .xp-controls { display: none; }
  71. .xp-controls { display: grid; gap: 7px; padding: 2px 0 12px; }
  72. .xp-untitled .xp-controls { padding-top: 8px; }
  73. /* a row: label on the left, control on the right */
  74. .xp-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 26px; }
  75. .xp-label { color: var(--xp-muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  76. .xp-k-swatch { align-items: start; }
  77. .xp-k-swatch .xp-label { padding-top: 3px; }
  78. /* select: a grey rounded dropdown */
  79. .xp-sel {
  80. appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; border: 0; border-radius: 7px; cursor: pointer;
  81. font-weight: 500; padding: 6px 24px 6px 9px; line-height: 1.2; color: var(--xp-fg);
  82. background: var(--xp-muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M.5.5 4 4 7.5.5' fill='none' stroke='%23888' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 9px center;
  83. text-overflow: ellipsis;
  84. }
  85. .xp-sel:hover { background-color: var(--xp-accent); }
  86. /* segment: 2-4 options as a segmented switch */
  87. .xp-seg { display: flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--xp-muted); }
  88. .xp-seg button {
  89. flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  90. padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; cursor: pointer;
  91. font-weight: 500; color: var(--xp-muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  92. transition: background var(--xp-dur) var(--xp-ease), color var(--xp-dur) var(--xp-ease);
  93. }
  94. .xp-seg button span { overflow: hidden; text-overflow: ellipsis; }
  95. .xp-seg button:hover { color: var(--xp-fg); }
  96. .xp-seg button[aria-checked="true"] { background: var(--xp-bg); color: var(--xp-fg); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--xp-border); }
  97. .xp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  98. /* bool: a toggle */
  99. .xp-switch {
  100. justify-self: start; position: relative; width: 30px; height: 18px; padding: 0; border: 0; border-radius: 99px; cursor: pointer;
  101. background: var(--xp-accent); box-shadow: inset 0 0 0 1px var(--xp-border); transition: background var(--xp-dur) var(--xp-ease);
  102. }
  103. .xp-switch i {
  104. position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--xp-bg);
  105. box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform var(--xp-dur) var(--xp-ease);
  106. }
  107. .xp-switch[aria-checked="true"] { background: var(--xp-strong); box-shadow: none; }
  108. .xp-switch[aria-checked="true"] i { transform: translateX(12px); }
  109. /* range: a black-thumb slider with a mono value */
  110. .xp-rangebox { display: flex; align-items: center; gap: 8px; }
  111. .xp-range { flex: 1; min-width: 0; height: 18px; accent-color: var(--xp-strong); cursor: pointer; background: transparent; -webkit-appearance: none; appearance: none; }
  112. .xp-range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: var(--xp-accent); }
  113. .xp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 0; border-radius: 50%; background: var(--xp-strong); }
  114. .xp-range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--xp-accent); }
  115. .xp-range::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--xp-strong); }
  116. .xp-val { min-width: 34px; text-align: right; font: 11px/1 var(--xp-mono); color: var(--xp-muted-fg); font-variant-numeric: tabular-nums; }
  117. /* swatch: colour dots, a ring on the chosen one */
  118. .xp-swatches { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 2px; }
  119. .xp-swatch {
  120. width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--sw);
  121. box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--xp-fg) 16%, transparent); transition: transform var(--xp-dur) var(--xp-ease);
  122. }
  123. .xp-swatch:hover { transform: scale(1.12); }
  124. .xp-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--xp-bg), 0 0 0 3.5px var(--xp-strong); }
  125. /* text */
  126. .xp-text { width: 100%; min-width: 0; border: 0; border-radius: 7px; padding: 6px 9px; background: var(--xp-muted); color: var(--xp-fg); }
  127. .xp-text:hover { background: var(--xp-accent); }
  128. /* footer: reset and copy link */
  129. .xp-foot { display: flex; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid var(--xp-border); }
  130. .xp-btn {
  131. flex: 1; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-weight: 500;
  132. background: var(--xp-muted); color: var(--xp-fg);
  133. }
  134. .xp-btn:hover { background: var(--xp-accent); }
  135. .xp-copy { position: fixed; left: -9999px; top: 0; }
  136. /* inline: the panel stands in a container of the page (a lens puts it first in its side panel) instead of floating */
  137. .xp.xp-inline { position: static; z-index: auto; }
  138. /* the container draws the frame (a lens section is already a card), so the panel has none of its own */
  139. .xp-inline .xp-panel { width: 100%; max-height: none; animation: none; background: transparent; box-shadow: none; border-radius: 0; }
  140. .xp-inline .xp-head { padding: 0 0 6px; }
  141. .xp-inline .xp-body { padding-left: 0; padding-right: 0; }
  142. .xp-inline .xp-foot { padding-left: 0; padding-right: 0; padding-bottom: 0; }
  143. @media (max-width: 560px) {
  144. .xp:not(.xp-inline) { top: auto; bottom: 10px; right: 10px; }
  145. .xp:not(.xp-inline) .xp-panel { width: min(var(--xp-w), calc(100vw - 20px)); max-height: 70vh; }
  146. }
  147. @media print { .xp { display: none; } }