shui.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. html * {
  2. border-color: hsl(var(--border));
  3. }
  4. html[data-theme=light] {
  5. --accent: var(--rx-gray-12-hsl);
  6. --accent-foreground: var(--rx-gray-02-hsl);
  7. --input: var(--rx-gray-05-hsl);
  8. --secondary: 240 4.8% 95.9%;
  9. --kbd-glow-top: transparent;
  10. --kbd-glow-bottom: rgba(0, 0, 0, 0.10);
  11. }
  12. html[data-theme=dark] {
  13. --accent: var(--rx-gray-12-hsl);
  14. --accent-foreground: var(--rx-gray-02-hsl);
  15. --primary-foreground: 0 0% 22%;
  16. --background: 0 0% 11%;
  17. --foreground: 0 0% 95%;
  18. --card: 0 0% 11%;
  19. --card-foreground: 0 0% 95%;
  20. --secondary: 0 0% 20%;
  21. --secondary-foreground: 0 0% 98%;
  22. --border: 0 0% 16%;
  23. --muted: 0 0% 15%;
  24. --popover: 0 0% 7%;
  25. --popover-foreground: 0 0 95%;
  26. --input: 0 0% 16%;
  27. --kbd-glow-top: rgba(255, 255, 255, 0.15);
  28. --kbd-glow-bottom: rgba(0, 0, 0, 0.25);
  29. }
  30. html {
  31. div[data-radix-menu-content],
  32. .ui__select-content {
  33. --accent: var(--rx-gray-04-hsl);
  34. --accent-foreground: var(--rx-gray-12-hsl);
  35. --muted: var(--rx-gray-05-hsl);
  36. }
  37. .ui__calendar {
  38. --accent: var(--rx-gray-04-hsl);
  39. --accent-foreground: var(--rx-gray-12-hsl);
  40. }
  41. &:not([data-color=logseq]) {
  42. .ui__dropdown-menu-item,
  43. div[data-radix-popper-content-wrapper] div[data-radix-collection-item] {
  44. &:focus, &.is-active {
  45. background-color: var(--lx-gray-04, hsl(var(--accent)));
  46. }
  47. }
  48. .ui__dropdown-menu-content.has-search-key {
  49. > .head:focus-within + div[data-radix-collection-item] {
  50. background-color: var(--lx-gray-04, hsl(var(--accent)));
  51. }
  52. }
  53. div[data-radix-popper-content-wrapper] div[role=menu],
  54. .menu-links-wrapper,
  55. .menu-links-outer,
  56. .absolute-modal[data-modal-name] {
  57. background-color: var(--lx-popover-bg, var(--lx-gray-01, hsl(var(--popover))));
  58. }
  59. }
  60. &[data-color=logseq] {
  61. .references-blocks-item {
  62. --lx-bg-override: var(--rx-gray-03-alpha);
  63. }
  64. .block-children-left-border:hover {
  65. --ls-block-left-color: var(--rx-logseq-11);
  66. }
  67. }
  68. &[data-color=none] {
  69. --ls-block-bullet-color: var(--rx-gray-08);
  70. --ls-block-bullet-active-color: var(--rx-gray-12);
  71. ::selection {
  72. @apply bg-primary/20;
  73. }
  74. #ui__ac-inner {
  75. }
  76. .cp__cmdk {
  77. --lx-gray-07: var(--rx-gray-07);
  78. }
  79. .ui__toggle {
  80. &-background-off {
  81. @apply bg-gray-08;
  82. .switcher {
  83. @apply bg-gray-10;
  84. }
  85. }
  86. &-background-on {
  87. .switcher {
  88. @apply bg-gray-03;
  89. }
  90. }
  91. }
  92. .tl-container {
  93. --ls-primary-background-color: hsl(var(--background));
  94. --ls-secondary-background-color: var(--rx-gray-01);
  95. --ls-tertiary-background-color: var(--rx-gray-03);
  96. --ls-quaternary-background-color: var(--rx-gray-05);
  97. }
  98. }
  99. }
  100. html[data-theme=light] {
  101. &[data-color=logseq] {
  102. .references-blocks-item {
  103. --lx-bg-override: var(--rx-gray-03-alpha);
  104. }
  105. }
  106. .extensions__pdf-container {
  107. --lx-pdf-container-dark-bg: var(--lx-gray-11, #042f3c);
  108. }
  109. }
  110. html[data-theme=dark] {
  111. background-color: #161616;
  112. &[data-color=logseq] {
  113. @apply bg-[#002b36];
  114. .ui__modal-panel {
  115. @apply border-accent-01;
  116. }
  117. .tippy-tooltip {
  118. @apply border-accent-02;
  119. }
  120. .references-blocks-item {
  121. background-color: var(--lx-gray-03, var(--ls-secondary-background-color));
  122. }
  123. .cp__right-sidebar-inner {
  124. .references-blocks-item {
  125. background-color: var(--lx-gray-04, var(--ls-tertiary-background-color));
  126. }
  127. }
  128. .cp__themes-installed {
  129. .it.is-active, .it:hover {
  130. @apply bg-accent-01;
  131. }
  132. }
  133. .ui__button {
  134. &.as-outline {
  135. --accent: 192 100% 12%;
  136. }
  137. }
  138. div[data-radix-menu-content],
  139. .ui__select-content {
  140. --accent: 190 100% 15%;
  141. --muted: 192 100% 13%;
  142. --secondary-foreground: 0 0% 82%;
  143. }
  144. .ui__button {
  145. &.as-ghost {
  146. @apply hover:bg-accent-01;
  147. }
  148. }
  149. .menu-separator {
  150. @apply opacity-20;
  151. }
  152. .ui__calendar {
  153. --accent: 196 100% 15%;
  154. }
  155. .rc-datepicker {
  156. --accent: 200 97% 37%;
  157. }
  158. .cp__cmdk {
  159. .border-gray-06,
  160. .border-gray-07 {
  161. border-color: var(--ls-border-color, var(--lx-gray-06));
  162. opacity: .6;
  163. }
  164. > .hints {
  165. @apply border-accent-01 bg-gray-02;
  166. }
  167. }
  168. .tl-button {
  169. &:hover {
  170. @apply bg-accent-02;
  171. }
  172. }
  173. .cp__header {
  174. > .r > div:not(.ui__dropdown-trigger) a.button, button.button,
  175. .ui__button.as-ghost {
  176. @apply opacity-60 hover:opacity-90;
  177. }
  178. }
  179. .form-input {
  180. @apply border-accent-01;
  181. }
  182. }
  183. }
  184. .ui__dialog-overlay, .ui__alert-dialog-overlay,
  185. .ui__dialog-content, .ui__alert-dialog-content,
  186. .ui__dropdown-menu-content, .ui__select-content {
  187. &.z-50 {
  188. @apply z-[999];
  189. }
  190. }
  191. div[data-radix-popper-content-wrapper] {
  192. @apply !z-[999];
  193. &:has(> .repos-list) {
  194. @apply !z-[var(--ls-z-index-level-5)];
  195. }
  196. }
  197. .ui__dialog-overlay {
  198. &[data-align=start],
  199. &[data-align=top] {
  200. @apply !items-start;
  201. .ui__dialog-content {
  202. @apply top-20;
  203. }
  204. }
  205. }
  206. .ui__dialog-content {
  207. @apply outline-none m-4;
  208. &[data-auto-width] {
  209. @apply max-w-[90vw] w-max sm:max-w-[960px];
  210. }
  211. &[data-close-btn=false] {
  212. .ui__dialog-close {
  213. @apply hidden;
  214. }
  215. }
  216. }
  217. .ui__alert-dialog-content {
  218. &[data-mode=confirm] {
  219. .ui__alert-dialog-footer {
  220. @apply flex justify-between font-normal items-center select-none;
  221. }
  222. }
  223. }
  224. /* Deprecated: .ui__button-shortcut-key - replaced by shui-shortcut-key */
  225. /* Unified Keyboard Shortcut Component Styles */
  226. /* Combo Keys - simultaneous key combinations with separator */
  227. .shui-shortcut-combo {
  228. @apply flex items-start relative rounded;
  229. background-color: var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  230. border: 1px solid var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  231. box-sizing: border-box;
  232. white-space: nowrap;
  233. min-width: 0;
  234. transition: transform 140ms ease-out, box-shadow 140ms ease-out, filter 140ms ease-out;
  235. filter: brightness(1);
  236. }
  237. /* Glow effect for combo and separate keys */
  238. /* Top highlight and bottom shadow use theme-aware variables for light/dark visibility */
  239. /* Combo keys: glow on container (wraps all keys together) */
  240. .shui-shortcut-combo.shui-shortcut-glow {
  241. box-shadow: var(--kbd-glow-top) 0px 1px 0px 0px inset, var(--kbd-glow-bottom) 0px -1px 0px 0px inset;
  242. border: none;
  243. }
  244. /* Separate keys: glow on individual keys (not container) */
  245. .shui-shortcut-separate.shui-shortcut-glow kbd.shui-shortcut-key {
  246. box-shadow: var(--kbd-glow-top) 0px 1px 0px 0px inset, var(--kbd-glow-bottom) 0px -1px 0px 0px inset;
  247. border: none;
  248. }
  249. .shui-shortcut-combo kbd.shui-shortcut-key {
  250. @apply flex flex-col items-center justify-center px-1 py-0.5 relative shrink-0;
  251. min-width: 20px;
  252. background: transparent;
  253. border: none;
  254. }
  255. .shui-shortcut-separator {
  256. background-color: var(--lx-gray-07-alpha, var(--rx-gray-07-alpha));
  257. align-self: stretch;
  258. flex-shrink: 0;
  259. width: 1px;
  260. }
  261. /* Separate Keys - sequential key presses with 4px gap */
  262. .shui-shortcut-separate {
  263. @apply flex items-start relative;
  264. gap: 4px;
  265. white-space: nowrap;
  266. min-width: 0;
  267. }
  268. .shui-shortcut-separate kbd.shui-shortcut-key {
  269. @apply flex flex-col items-center justify-center px-1 py-0.5 relative rounded shrink-0;
  270. background-color: var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  271. border: 1px solid var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  272. box-sizing: border-box;
  273. min-width: 20px;
  274. }
  275. /* Compact Keys - minimal text-only style */
  276. .shui-shortcut-compact {
  277. @apply flex items-start relative;
  278. font-family: 'Inter', sans-serif;
  279. font-weight: normal;
  280. line-height: 16px;
  281. font-style: normal;
  282. color: var(--lx-gray-12, var(--rx-gray-12));
  283. font-size: 12px;
  284. text-align: center;
  285. letter-spacing: -0.5px;
  286. white-space: nowrap;
  287. gap: 2px;
  288. }
  289. /* Individual key styling with inner glow */
  290. kbd.shui-shortcut-key,
  291. .shui-shortcut-key {
  292. @apply text-xs font-normal h-5 flex items-center justify-center;
  293. font-family: 'Inter', sans-serif;
  294. color: var(--lx-gray-12, var(--rx-gray-12));
  295. font-size: 12px;
  296. text-align: center;
  297. letter-spacing: -0.5px;
  298. padding: 2px 4px;
  299. line-height: 16px;
  300. min-width: fit-content;
  301. transition: transform 140ms ease-out, box-shadow 140ms ease-out, filter 140ms ease-out;
  302. box-shadow: 0 0 0 transparent;
  303. filter: brightness(1);
  304. }
  305. /* Keys in separate containers get their own styling */
  306. .shui-shortcut-separate kbd.shui-shortcut-key {
  307. @apply rounded;
  308. background-color: var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  309. border: 1px solid var(--lx-gray-06-alpha, var(--rx-gray-06-alpha));
  310. box-sizing: border-box;
  311. }
  312. /* Override shortcut text color inside primary buttons for better contrast */
  313. .bg-primary kbd.shui-shortcut-key,
  314. .bg-primary .shui-shortcut-key,
  315. .bg-primary .shui-shortcut-compact,
  316. .bg-primary\/90 kbd.shui-shortcut-key,
  317. .bg-primary\/90 .shui-shortcut-key,
  318. .bg-primary\/90 .shui-shortcut-compact,
  319. .bg-primary\/100 kbd.shui-shortcut-key,
  320. .bg-primary\/100 .shui-shortcut-key,
  321. .bg-primary\/100 .shui-shortcut-compact {
  322. color: hsl(var(--primary-foreground));
  323. }
  324. /* Key press animation — separate keys: animate individual kbd elements */
  325. kbd.shui-shortcut-key-pressed,
  326. .shui-shortcut-key-pressed {
  327. transform: translateY(1px);
  328. filter: brightness(0.92);
  329. }
  330. .shui-shortcut-separate.shui-shortcut-glow kbd.shui-shortcut-key-pressed {
  331. box-shadow: var(--kbd-glow-top) 0px 2px 0px 0px inset, var(--kbd-glow-bottom) 0px -0.5px 0px 0px inset;
  332. }
  333. /* Key press animation — combo keys: animate the container (the whole keycap) */
  334. .shui-shortcut-combo.shui-shortcut-key-pressed {
  335. transform: translateY(1px);
  336. filter: brightness(0.92);
  337. }
  338. .shui-shortcut-combo.shui-shortcut-glow.shui-shortcut-key-pressed {
  339. box-shadow: var(--kbd-glow-top) 0px 2px 0px 0px inset, var(--kbd-glow-bottom) 0px -0.5px 0px 0px inset;
  340. }
  341. /* Row highlight animation — accent band sweep (only on actual row elements) */
  342. .shui-shortcut-row.shui-shortcut-row--pressed,
  343. .shortcut-row.shui-shortcut-row--pressed {
  344. background-image: linear-gradient(
  345. 90deg,
  346. transparent 0%,
  347. transparent 35%,
  348. rgba(223, 239, 254, 0.08) 50%,
  349. transparent 65%,
  350. transparent 100%
  351. );
  352. background-size: 300% 100%;
  353. background-repeat: no-repeat;
  354. animation: shortcut-row-sweep 700ms ease-out forwards;
  355. }
  356. @keyframes shortcut-row-sweep {
  357. from { background-position: -50% 0; }
  358. to { background-position: 150% 0; }
  359. }
  360. /* Ensure consistent height for shortcut containers */
  361. .shui-shortcut-row {
  362. min-height: 20px;
  363. align-items: center;
  364. flex-wrap: nowrap;
  365. }
  366. /* Respect reduced motion preference */
  367. @media (prefers-reduced-motion: reduce) {
  368. kbd.shui-shortcut-key,
  369. .shui-shortcut-key,
  370. .shui-shortcut-combo {
  371. transition: none;
  372. transform: none;
  373. filter: none;
  374. box-shadow: 0 0 0 transparent;
  375. }
  376. .shui-shortcut-row.shui-shortcut-row--pressed,
  377. .shortcut-row.shui-shortcut-row--pressed {
  378. animation: none !important;
  379. background-image: none !important;
  380. }
  381. }
  382. .ui__list-item-highlighted-span {
  383. background-color: var(--lx-accent-06, var(--color-level-4));
  384. }
  385. .dark .ui__list-item-highlighted-span {
  386. background-color: var(--lx-accent-08-alpha, var(--color-level-4));
  387. }
  388. .ui__dropdown-menu-content, div[data-radix-menu-content],
  389. .ui__select-content {
  390. @apply overflow-y-auto;
  391. &[data-side=top] {
  392. max-height: calc(var(--radix-dropdown-menu-content-available-height) - 20px);
  393. }
  394. &[data-side=bottom] {
  395. max-height: calc(var(--radix-dropdown-menu-content-available-height) - 10px);
  396. }
  397. &.text-popover-foreground {
  398. color: inherit;
  399. }
  400. }
  401. .ui__popover-content {
  402. @apply overflow-y-auto;
  403. &[data-side=top] {
  404. max-height: calc(var(--radix-popover-content-available-height) - 40px);
  405. }
  406. &[data-side=bottom] {
  407. max-height: calc(var(--radix-popover-content-available-height) - 20px);
  408. }
  409. }
  410. .ui__popover-content {
  411. @apply !pointer-events-auto;
  412. }
  413. .ui__multi-select-content {
  414. @apply relative;
  415. > .head {
  416. @apply sticky top-0 z-10;
  417. }
  418. .search-input {
  419. > .ui__input {
  420. @apply rounded-[1px] h-8;
  421. }
  422. }
  423. &:has([data-radix-collection-item]) {
  424. > .head {
  425. @apply mb-1.5;
  426. }
  427. }
  428. }
  429. .ui__calendar {
  430. .rdp-caption_dropdowns {
  431. @apply flex items-center justify-center relative rounded opacity-80;
  432. .rdp-vhidden {
  433. @apply hidden;
  434. }
  435. .rdp-dropdown_month,
  436. .rdp-dropdown_year {
  437. @apply relative pr-3 mr-3;
  438. select {
  439. @apply absolute px-2 py-0 border left-0 z-[2] opacity-0 bg-none;
  440. }
  441. > .text-sm {
  442. @apply w-full z-[1];
  443. svg {
  444. @apply absolute right-0 top-[6px];
  445. }
  446. }
  447. }
  448. .rdp-dropdown_month {
  449. @apply ml-4;
  450. }
  451. & + div {
  452. @apply absolute -right-1 flex gap-2;
  453. button[name=previous-month] {
  454. @apply relative;
  455. svg {
  456. width: 14px;
  457. height: 14px;
  458. }
  459. }
  460. button[name=next-month] {
  461. @apply relative;
  462. svg {
  463. width: 14px;
  464. height: 14px;
  465. }
  466. }
  467. }
  468. }
  469. .rdp-caption_start {
  470. > div {
  471. @apply justify-start;
  472. }
  473. }
  474. .del-date-btn {
  475. @apply absolute right-[4px] top-[17px] px-1 opacity-70 hover:opacity-100
  476. active:opacity-80 hover:text-red-rx-09 rounded-md !h-6 !w-6;
  477. }
  478. &.has-del-btn {
  479. .rdp-caption_dropdowns {
  480. & + div {
  481. @apply right-5;
  482. }
  483. }
  484. }
  485. input[type=number] {
  486. appearance: initial;
  487. }
  488. .rdp-button {
  489. &[name=previous-month], &[name=next-month] {
  490. @apply !h-6 !w-6;
  491. }
  492. }
  493. }
  494. .popper-arrow {
  495. fill: white;
  496. filter: drop-shadow(0 0 3px var(--lx-gray-12));
  497. clip-path: inset(0 -10px -10px -10px);
  498. }
  499. .dark-theme {
  500. .popper-arrow {
  501. /* FIXME: set the best color for different themes */
  502. fill: none;
  503. }
  504. }