container.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. @supports (padding: max(0px)) {
  2. .post {
  3. padding-left: max(12px, env(safe-area-inset-left));
  4. padding-right: max(12px, env(safe-area-inset-right));
  5. }
  6. }
  7. #app-container {
  8. background-color: or(--logseq-og-top-bar-background, --lx-gray-01, --ls-primary-background-color, #fff);
  9. position: relative;
  10. }
  11. .dark #app-container {
  12. background-color: or(--logseq-og-top-bar-background, --lx-gray-02, --ls-primary-background-color, #fff);
  13. }
  14. #root {
  15. > div {
  16. color: or(--logseq-og-document-text-color, --lx-gray-12, --ls-primary-text-color, #24292e);
  17. font-size: var(--ls-page-text-size);
  18. }
  19. }
  20. #app-container {
  21. display: flex;
  22. flex: 0 0 100%;
  23. }
  24. #skip-to-main {
  25. @apply fixed p-2 rounded;
  26. left: 50%;
  27. transform: translate(-50%, 0);
  28. background-color: var(--ls-secondary-background-color);
  29. top: -100px;
  30. z-index: 10000;
  31. transition: top 0.3s;
  32. &:focus {
  33. top: 20px;
  34. }
  35. }
  36. #left-container {
  37. @apply flex flex-1 flex-col relative h-screen;
  38. }
  39. #main-container {
  40. /* Hack: (overflow-y) to fix sticky header not working */
  41. /* To reproduce: quick creating blocks */
  42. overflow-y: hidden;
  43. position: relative;
  44. height: 100%;
  45. transition: padding-left .3s;
  46. &.is-left-sidebar-open {
  47. padding-left: 0;
  48. @screen sm {
  49. padding-left: var(--ls-left-sidebar-width);
  50. }
  51. }
  52. }
  53. #main-content {
  54. position: relative;
  55. height: calc(100vh - var(--ls-headbar-height));
  56. }
  57. #main-content-container {
  58. @apply p-4 sm:px-8;
  59. font-size: 1em;
  60. }
  61. #main-content-container[data-is-margin-less-pages=true] {
  62. padding: 0 !important;
  63. position: relative;
  64. overflow: auto;
  65. }
  66. .dark .left-sidebar-inner {
  67. background-color: or(--lx-gray-01, --ls-primary-background);
  68. }
  69. .left-sidebar-inner {
  70. position: relative;
  71. height: 100%;
  72. padding-top: 12px;
  73. width: var(--ls-left-sidebar-sm-width);
  74. overflow-y: auto;
  75. overflow-x: hidden;
  76. background-color: or(--lx-gray-02, --ls-primary-background-color);
  77. transition: transform .3s;
  78. transform: translate3d(-100%, 0, 0);
  79. z-index: 3;
  80. -webkit-font-smoothing: antialiased;
  81. > .wrap {
  82. height: calc(100vh - var(--ls-headbar-inner-top-padding) - 50px);
  83. margin-top: 30px;
  84. width: 100%;
  85. padding-top: var(--ls-win32-title-bar-height);
  86. > .fake-bar {
  87. @apply w-full px-5 pt-1 sm:hidden;
  88. top: -45px;
  89. }
  90. }
  91. .dropdown-wrapper {
  92. min-width: 180px;
  93. margin-top: 1px;
  94. .menu-link {
  95. padding: 5px 15px;
  96. opacity: .8;
  97. &:hover {
  98. opacity: 1;
  99. }
  100. }
  101. }
  102. .page-icon {
  103. @apply flex items-center mr-1 align-baseline;
  104. width: 20px;
  105. flex-shrink: 0;
  106. height: 18px;
  107. text-align: center;
  108. display: inline-block;
  109. line-height: 1em;
  110. }
  111. a.item {
  112. @apply px-2 py-2 sm:py-1.5;
  113. user-select: none;
  114. transition: background-color .3s;
  115. .ui__icon {
  116. width: 20px;
  117. text-align: center;
  118. font-size: 16px;
  119. margin-right: 8px;
  120. opacity: .9;
  121. position: relative;
  122. }
  123. &:hover {
  124. background-color: or(--logseq-og-left-sidebar-hover-background, --lx-gray-04, --ls-tertiary-background-color);
  125. color: or(--logseq-og-left-sidebar-text-color-hover, --lx-gray-12, --ls-header-button-background);
  126. }
  127. &.active, &:active {
  128. background-color: or(--logseq-og-left-sidebar-active-background, --lx-gray-05, --ls-quaternary-background-color);
  129. color: or(--logseq-og-left-sidebar-active-text-color, --lx-gray-12, --ls-quaternary-background-color);
  130. }
  131. }
  132. .nav-contents-container {
  133. @apply h-full flex-grow-0 flex-grow-0
  134. overflow-x-hidden overflow-y-auto;
  135. padding-bottom: 60px;
  136. &.is-scrolled {
  137. border-top: 1px solid var(--ls-tertiary-border-color);
  138. }
  139. }
  140. .nav-content-item {
  141. &-inner {
  142. border-radius: 8px;
  143. }
  144. .header {
  145. @apply px-6 py-1;
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: center;
  149. user-select: none;
  150. cursor: pointer;
  151. > span {
  152. > a {
  153. padding-left: 12px;
  154. display: none;
  155. transition: none;
  156. &:last-child {
  157. transform: translateY(-6px) translateX(2px) rotate(90deg);
  158. transform-origin: center center;
  159. transition: .15s transform;
  160. }
  161. }
  162. }
  163. &:hover {
  164. background-color: or(--lx-gray-04, --ls-tertiary-background-color);
  165. * {
  166. opacity: 1 !important;
  167. }
  168. > span {
  169. > a {
  170. display: block;
  171. &:last-child {
  172. display: block;
  173. opacity: .6;
  174. }
  175. }
  176. }
  177. }
  178. .wrap-th {
  179. > span {
  180. font-size: 11px;
  181. font-weight: 600;
  182. }
  183. }
  184. }
  185. .bd {
  186. display: none;
  187. ul {
  188. list-style: none;
  189. padding: 0;
  190. margin: 0;
  191. li {
  192. margin: 0;
  193. }
  194. a {
  195. width: 100%;
  196. padding: 4px 24px;
  197. transition: background-color .3s;
  198. .page-title {
  199. white-space: nowrap;
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. flex-grow: 1;
  203. }
  204. .page-icon {
  205. display: flex;
  206. align-items: center;
  207. }
  208. &:hover {
  209. background-color: or(--lx-gray-04, --ls-quaternary-background-color);
  210. }
  211. }
  212. }
  213. }
  214. &.is-expand {
  215. .header > span > a {
  216. &:last-child {
  217. transform: translateY(2px) translateX(-3px);
  218. }
  219. }
  220. .bd {
  221. display: block;
  222. }
  223. }
  224. }
  225. .create {
  226. position: absolute;
  227. bottom: 0;
  228. left: 0;
  229. width: 100%;
  230. padding: 14px;
  231. background-image: linear-gradient(transparent, var(--ls-primary-background-color));
  232. user-select: none;
  233. @screen sm {
  234. background-image: linear-gradient(transparent, or(--logseq-og-left-sidebar-bottom-gradient, --lx-gray-02, --ls-secondary-background-color));
  235. .dark & {
  236. background-image: linear-gradient(transparent, or(--logseq-og-left-sidebar-bottom-gradient, --lx-gray-01, --ls-secondary-background-color));
  237. }
  238. }
  239. &-link {
  240. background-color: var(--ls-primary-background-color);
  241. box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  242. }
  243. .dropdown-wrapper {
  244. top: initial;
  245. right: initial;
  246. bottom: calc(100% + 6px);
  247. left: 0;
  248. width: max-content;
  249. @screen sm {
  250. bottom: 0;
  251. left: calc(100% + 6px);
  252. }
  253. }
  254. #create-button {
  255. @apply flex items-center justify-center p-2 text-sm font-medium rounded-md w-full border;
  256. background-color: or(--lx-gray-03, --ls-secondary-background-color) !important;
  257. border-color: transparent;
  258. &:hover,
  259. &:focus {
  260. border-color: var(--ls-border-color);
  261. background-color: or(--lx-gray-03, --ls-primary-background-color) !important;
  262. }
  263. @screen sm {
  264. background-color: or(--lx-gray-03, --ls-primary-background-color) !important;
  265. &:hover,
  266. &:focus {
  267. background-color: or(--lx-gray-04, --ls-secondary-background-color) !important;
  268. }
  269. }
  270. }
  271. }
  272. @screen sm {
  273. padding-top: 0;
  274. width: var(--ls-left-sidebar-width);
  275. background-color: or(--lx-gray-02, --ls-secondary-background-color);
  276. .dark & {
  277. background-color: or(--logseq-og-left-sidebar-background, --lx-gray-01, --ls-secondary-background-color);
  278. }
  279. > .wrap {
  280. margin-top: 52px;
  281. }
  282. .create {
  283. &-link {
  284. background-color: var(--ls-primary-background-color);
  285. }
  286. }
  287. }
  288. }
  289. .cp__sidebar-left-layout {
  290. position: fixed;
  291. top: 0;
  292. left: 0;
  293. z-index: var(--ls-z-index-level-5);
  294. width: 10px;
  295. a {
  296. @apply opacity-90 hover:opacity-100;
  297. transition: all 120ms ease-out;
  298. color: or(--logseq-og-left-sidebar-text-color, --lx-gray-11, --ls-header-button-background);
  299. }
  300. > .left-sidebar-inner {
  301. padding-top: var(--ls-headbar-inner-top-padding);
  302. }
  303. > .shade-mask {
  304. background-color: rgba(0, 0, 0, .7);
  305. position: absolute;
  306. top: 0;
  307. left: 0;
  308. bottom: 0;
  309. right: 0;
  310. z-index: 1;
  311. opacity: 0;
  312. transition: opacity .4s;
  313. touch-action: none;
  314. }
  315. &.is-touching {
  316. width: 100% !important;
  317. transition: none;
  318. .left-sidebar-inner {
  319. transition: none !important;
  320. }
  321. > .shade-mask {
  322. transition: none !important;
  323. z-index: 1;
  324. }
  325. }
  326. &.is-open {
  327. width: 100%;
  328. .left-sidebar-inner {
  329. transform: translate3d(0, 0, 0);
  330. overflow: hidden;
  331. }
  332. > .shade-mask {
  333. opacity: 1;
  334. z-index: 1;
  335. }
  336. }
  337. &.is-closing {
  338. .left-sidebar-inner {
  339. transition: transform .3s;
  340. transform: translate3d(-100%, 0, 0) !important;
  341. }
  342. > .shade-mask {
  343. opacity: 0;
  344. z-index: 1;
  345. }
  346. }
  347. &:before {
  348. content: " ";
  349. height: 3rem;
  350. background-color: var(--ls-primary-background-color);
  351. position: fixed;
  352. left: 0;
  353. top: 0;
  354. opacity: 1;
  355. z-index: 5;
  356. }
  357. @screen sm {
  358. width: 0;
  359. z-index: var(--ls-z-index-level-1);
  360. transition: width .3s;
  361. &:before {
  362. background-color: or(--lx-gray-02, --ls-secondary-background-color);
  363. width: 0;
  364. overflow: hidden;
  365. }
  366. &.is-open {
  367. width: var(--ls-left-sidebar-width);
  368. .left-sidebar-inner {
  369. overflow: visible;
  370. }
  371. }
  372. > .shade-mask {
  373. display: none;
  374. }
  375. }
  376. }
  377. .ls-left-sidebar-open {
  378. @screen sm {
  379. .cp__header > .r {
  380. display: flex;
  381. }
  382. }
  383. }
  384. .ls-window-controls {
  385. &.ls-right-sidebar-open {
  386. .cp__right-sidebar-topbar {
  387. margin-right: 144px;
  388. .is-fullscreen & {
  389. margin-right: 48px;
  390. }
  391. }
  392. }
  393. &:not(.ls-right-sidebar-open) {
  394. .cp__header > .r {
  395. margin-right: 144px;
  396. .is-fullscreen & {
  397. margin-right: 48px;
  398. }
  399. }
  400. }
  401. }
  402. .ls-wide-mode {
  403. .cp__sidebar-main-content {
  404. max-width: var(--ls-main-content-max-width-wide);
  405. }
  406. }
  407. html[data-theme='dark'] {
  408. #left-sidebar {
  409. > .shade-mask {
  410. background-color: rgba(0, 0, 0, .15);
  411. }
  412. }
  413. }
  414. .settings-modal {
  415. @apply -m-8 rounded-lg;
  416. /* box-shadow: inset 0 0 0 1px var(--ls-border-color); */
  417. }
  418. .cp__sidebar-main-layout {
  419. background-color: or(--logseq-og-main-content-background, --lx-gray-01, --ls-primary-background-color);
  420. }
  421. .dark .cp__sidebar-main-layout {
  422. background-color: or(--logseq-og-main-content-background, --lx-gray-02, --ls-primary-background-color);
  423. }
  424. .cp__sidebar-main-content {
  425. width: 100%;
  426. max-width: var(--ls-main-content-max-width);
  427. flex: 1;
  428. }
  429. .cp__sidebar-help {
  430. &-docs {
  431. @apply ml-2 mt-1;
  432. td {
  433. word-break: break-all;
  434. }
  435. th {
  436. width: 80%;
  437. }
  438. }
  439. &-btn {
  440. @apply fixed bottom-4 right-8;
  441. > .inner {
  442. @apply font-bold
  443. rounded-full h-8 w-8 flex items-center justify-center font-bold
  444. select-none cursor-help;
  445. background-color: or(--lx-gray-01, --ls-secondary-background-color);
  446. }
  447. }
  448. }
  449. .cp__right-sidebar {
  450. z-index: var(--ls-z-index-level-1);
  451. transition: width 0.3s;
  452. background-color: or(--lx-gray-01, --ls-secondary-background-color, #d8e1e8);
  453. position: relative;
  454. user-select: none;
  455. .resizer {
  456. @apply absolute top-0 bottom-0;
  457. touch-action: none;
  458. left: 0;
  459. width: 4px;
  460. user-select: none;
  461. cursor: col-resize !important;
  462. transition: background-color 300ms;
  463. transition-delay: 300ms;
  464. z-index: 1000;
  465. &:hover,
  466. &:focus,
  467. &:active {
  468. background-color: var(--ls-active-primary-color);
  469. }
  470. }
  471. &.closed {
  472. width: 0 !important;
  473. @screen lg {
  474. width: 4px !important;
  475. }
  476. }
  477. &.open {
  478. max-width: 60vw;
  479. }
  480. &-scollable {
  481. min-height: 100%;
  482. overflow-y: scroll;
  483. }
  484. &-inner {
  485. padding-top: 0;
  486. }
  487. &-settings {
  488. @apply flex flex-row;
  489. margin-bottom: 0;
  490. margin-top: 0;
  491. overflow: auto;
  492. &-btn {
  493. display: block;
  494. white-space: nowrap;
  495. }
  496. }
  497. &-topbar {
  498. position: sticky;
  499. position: -webkit-sticky;
  500. top: 0;
  501. left: 0;
  502. right: 0;
  503. background-color: or(--lx-gray-01, --ls-secondary-background-color, #d8e1e8);
  504. z-index: 999;
  505. user-select: none;
  506. -webkit-app-region: drag;
  507. a,
  508. svg,
  509. button {
  510. -webkit-app-region: no-drag;
  511. }
  512. }
  513. .page {
  514. margin-top: 0;
  515. }
  516. .non-block-editor textarea,
  517. pre,
  518. pre.code {
  519. margin: 0;
  520. padding: 0;
  521. font-size: 90%;
  522. background: none;
  523. }
  524. .references {
  525. margin-left: 12px;
  526. }
  527. .sidebar-item {
  528. @apply p-4;
  529. .close {
  530. transform: scale(0.8);
  531. transition: transform 0.1s;
  532. &:hover {
  533. transform: scale(1);
  534. }
  535. }
  536. }
  537. }
  538. .cp__sidebar-main-content[data-is-full-width='true'] {
  539. max-width: 100vw;
  540. }
  541. .cp__sidebar-main-content[data-is-margin-less-pages='true'] {
  542. padding: 0;
  543. }
  544. .cp__menubar-repos {
  545. .title-wrap {
  546. line-height: 1.2em;
  547. padding: 1px 0;
  548. }
  549. }
  550. /* Workaround for Linux Intel GPU text rendering issue GH#7233 */
  551. .is-electron.is-linux .cp__menubar-repos {
  552. #repo-switch, .nav-header .flex-1 {
  553. position: relative;
  554. }
  555. }
  556. @supports not (overflow-y: overlay) {
  557. .scrollbar-spacing {
  558. overflow-y: auto;
  559. }
  560. }
  561. @supports (overflow-y: overlay) {
  562. .scrollbar-spacing {
  563. overflow-y: overlay;
  564. }
  565. }
  566. .favorites li.dragging-target {
  567. border-left: 5px solid green;
  568. }
  569. .full-height-without-header {
  570. height: calc(100vh - var(--ls-headbar-height) - 4rem);
  571. }
  572. a.ui__modal-close svg, a.close svg, span.rotating-arrow svg {
  573. color: var(--ls-primary-text-color);
  574. }
  575. a.ui__modal-close, a.close {
  576. color: var(--ls-primary-text-color);
  577. opacity: 0.6;
  578. }
  579. a.ui__modal-close:hover, a.close:hover {
  580. opacity: 1;
  581. }