container.css 13 KB

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