block.css 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. .block-content-wrapper {
  2. user-select: text;
  3. @screen sm {
  4. overflow-x: visible;
  5. }
  6. }
  7. .block-content {
  8. @apply min-h-[24px] max-w-full whitespace-pre-wrap break-words cursor-text;
  9. img {
  10. max-width: 100%;
  11. /* FIXME: img macros */
  12. &.left {
  13. float: left;
  14. }
  15. &.right {
  16. float: right;
  17. }
  18. &.loading-asset {
  19. width: 9px;
  20. }
  21. }
  22. .asset-container {
  23. @apply relative inline-block mt-2;
  24. .asset-action-bar {
  25. @apply top-0.5 right-0.5 absolute flex items-center
  26. border bg-gray-02 rounded opacity-0 transition-opacity;
  27. }
  28. .asset-action-btn {
  29. @apply m-1 p-0.5 truncate flex items-center opacity-70 select-none
  30. hover:opacity-90 active:opacity-60;
  31. }
  32. &:hover, &:active {
  33. .asset-action-bar {
  34. @apply opacity-100;
  35. }
  36. }
  37. }
  38. .resize {
  39. display: inline-flex;
  40. /* Fix chrome missing resize handle issue https://bugs.chromium.org/p/chromium/issues/detail?id=1135676&q=css%20resize%20type%3DBug&can=2.*/
  41. transform: translate3d(0, 0, 0);
  42. }
  43. .draw [aria-labelledby="shapes-title"] {
  44. position: absolute;
  45. left: 50%;
  46. transform: translate(-50%);
  47. }
  48. &-fallback-ui {
  49. padding: 10px 15px;
  50. border-color: var(--ls-secondary-border-color);
  51. }
  52. [data-tooltipped]:has(a.tag) {
  53. @apply px-0.5;
  54. }
  55. }
  56. .block-content-or-editor-wrap {
  57. @apply flex flex-1 flex-row flex-wrap gap-1;
  58. }
  59. .block-head-wrap {
  60. @apply flex flex-1 w-full flex-row flex-wrap;
  61. @apply justify-between items-center;
  62. }
  63. .breadcrumb {
  64. .asset-container > img {
  65. height: 18px;
  66. width: unset !important;
  67. }
  68. .inline-wrap {
  69. & > div, & > div > div {
  70. display: inherit;
  71. }
  72. }
  73. &.block-parents {
  74. .ui__icon {
  75. position: relative;
  76. top: 4px;
  77. }
  78. a {
  79. color: var(--ls-primary-text-color);
  80. &:hover {
  81. opacity: 1;
  82. }
  83. }
  84. }
  85. .page-ref {
  86. @apply inline-flex items-baseline;
  87. }
  88. }
  89. .open-block-ref-link {
  90. background-color: var(--ls-page-properties-background-color);
  91. padding: 1px 4px;
  92. border-radius: 2px;
  93. }
  94. .block-body {
  95. blockquote:first-child,
  96. pre:first-child {
  97. margin-top: 8px;
  98. margin-bottom: 8px;
  99. }
  100. }
  101. .block-body ul,
  102. .block-body ol,
  103. .block-body dl {
  104. margin-bottom: 0;
  105. > li {
  106. margin: 0;
  107. }
  108. }
  109. .block-body ol {
  110. list-style-position: inside;
  111. margin-left: 0;
  112. > li {
  113. &::marker,
  114. > p {
  115. display: initial;
  116. }
  117. }
  118. }
  119. .block-children-container {
  120. position: relative;
  121. margin-left: 29px;
  122. }
  123. .block-children-left-border {
  124. z-index: 1;
  125. width: 4px;
  126. left: -1px;
  127. top: 0;
  128. height: 100%;
  129. cursor: pointer;
  130. background-clip: content-box;
  131. background-color: transparent;
  132. position: absolute;
  133. border-radius: 2px;
  134. opacity: 0.6;
  135. border-left-color: var(--lx-gray-09, var(--ls-border-color, var(--rx-gray-09)));
  136. &:hover {
  137. background-color: var(--lx-gray-10, var(--ls-primary-text-color, var(--rx-gray-10)));
  138. opacity: .7;
  139. }
  140. &:active {
  141. opacity: 1;
  142. }
  143. }
  144. .block-children {
  145. border-left: 1px solid;
  146. border-left-color: var(--lx-gray-04-alpha, var(--ls-guideline-color, var(--rx-gray-04-alpha))) !important;
  147. }
  148. .hidden-block .block-children {
  149. border-left: 0;
  150. }
  151. .block-control-wrap, .ls-page-title .property-value .block-control-wrap {
  152. @apply h-[24px];
  153. &.is-order-list {
  154. @apply mr-0 pr-0;
  155. .bullet-link-wrap {
  156. @apply relative left-[-3px];
  157. }
  158. }
  159. &.bullet-hidden {
  160. padding-right: 2px;
  161. }
  162. }
  163. .ls-page-title .block-control-wrap {
  164. height: initial;
  165. }
  166. .block-title-wrap {
  167. @apply inline;
  168. > .ui__checkbox {
  169. @apply relative top-[2px];
  170. > span {
  171. @apply h-full;
  172. }
  173. }
  174. &.as-heading {
  175. @apply flex flex-1 items-center;
  176. > .ui__checkbox {
  177. @apply top-0;
  178. }
  179. h1& {
  180. .ui__icon.ti svg {
  181. @apply w-8 h-7;
  182. }
  183. }
  184. h2& {
  185. .ui__icon.ti svg {
  186. @apply w-7 h-6;
  187. }
  188. }
  189. h3& {
  190. .ui__icon.ti svg {
  191. @apply w-5 h-5;
  192. }
  193. }
  194. }
  195. &:has(.dsl-query), &:has(.embed-page) {
  196. @apply flex flex-row w-full;
  197. > .embed-page {
  198. @apply w-full;
  199. }
  200. }
  201. .dsl-query {
  202. @apply w-full;
  203. }
  204. }
  205. .block-control {
  206. @apply decoration-0 text-sm cursor-default
  207. min-w-[22px] min-h-[22px] p-0.5 select-none opacity-40;
  208. .control-hide {
  209. @apply hidden;
  210. }
  211. &:active {
  212. @apply opacity-30;
  213. }
  214. }
  215. .block-left-menu {
  216. background-color: var(--ls-secondary-background-color);
  217. background: linear-gradient(90deg, var(--ls-primary-background-color) 0%, var(--ls-secondary-background-color) 100%);
  218. .commands-button {
  219. @apply overflow-hidden flex max-w-[40px];
  220. .indent {
  221. @apply flex items-center w-full justify-center opacity-30;
  222. }
  223. }
  224. }
  225. .block-right-menu {
  226. background-color: var(--ls-secondary-background-color);
  227. /* background: linear-gradient(-90deg, var(--ls-primary-background-color) 0%, var(--ls-secondary-background-color) 100%); */
  228. .commands-button {
  229. @apply overflow-hidden flex flex-nowrap;
  230. .outdent, .more {
  231. @apply flex items-center justify-center
  232. overflow-hidden opacity-30 m-0 w-[40px];
  233. }
  234. }
  235. }
  236. .block-ref {
  237. @apply border-b-[0.5px] border-b-[--ls-block-ref-link-text-color] cursor-alias;
  238. display: inherit;
  239. margin-bottom: -1px;
  240. .block-ref {
  241. @apply mx-1;
  242. }
  243. &:hover {
  244. color: var(--ls-link-text-hover-color);
  245. }
  246. .block-content {
  247. cursor: inherit;
  248. &-inner {
  249. display: inherit;
  250. > * {
  251. display: inherit;
  252. }
  253. }
  254. }
  255. }
  256. .block-ref-no-title {
  257. border-bottom: 0.5px solid;
  258. border-bottom-color: var(--ls-block-ref-link-text-color);
  259. cursor: alias;
  260. padding: 2px 5px;
  261. display: block;
  262. &:hover {
  263. color: var(--ls-link-text-hover-color);
  264. }
  265. .block-content {
  266. cursor: inherit;
  267. }
  268. }
  269. .page-reference {
  270. @apply rounded transition-[background];
  271. .bracket {
  272. @apply opacity-30;
  273. }
  274. &:hover {
  275. background: var(--lx-accent-04-alpha, var(--ls-secondary-background-color, hsl(var(--primary)/.4)));
  276. }
  277. }
  278. .page-ref {
  279. @apply inline;
  280. color: var(--lx-accent-11, var(--ls-link-text-color, hsl(var(--primary)/.8)));
  281. &:hover {
  282. color: var(--lx-accent-11, var(--ls-link-text-color, hsl(var(--primary))));
  283. }
  284. .ui__icon.ti {
  285. @apply relative top-[3px] left-0;
  286. }
  287. }
  288. .asset-ref {
  289. &-wrap {
  290. &[data-ext=pdf] {
  291. display: inline-flex;
  292. align-items: center;
  293. }
  294. }
  295. &.is-doc {
  296. &:before {
  297. content: "[[📜";
  298. opacity: .7;
  299. margin-right: 4px;
  300. }
  301. &:after {
  302. content: "]]";
  303. opacity: .7;
  304. }
  305. }
  306. }
  307. .embed-page {
  308. @apply py-2 my-2 px-2;
  309. > section {
  310. margin-bottom: 5px;
  311. }
  312. &.in-sidebar {
  313. background-color: var(--ls-tertiary-background-color);
  314. }
  315. }
  316. .block-properties, .page-properties {
  317. margin: 4px 0;
  318. padding: 4px 8px;
  319. background-color: var(--lx-gray-03, var(--ls-block-properties-background-color, var(--rx-gray-03)));
  320. }
  321. .block-marker {
  322. padding: 2px 4px;
  323. opacity: 0.7;
  324. font-size: 85%;
  325. margin: 0 2px 0 0;
  326. font-weight: 650;
  327. border: 0;
  328. }
  329. .marker-switch {
  330. &:hover {
  331. color: var(--ls-link-text-hover-color);
  332. opacity: 1;
  333. }
  334. }
  335. .block-main-container {
  336. @apply min-h-[24px];
  337. &[data-has-heading="1"], &:has(textarea.h1) {
  338. > .block-control-wrap {
  339. @apply relative top-4;
  340. }
  341. .block-content-or-editor-wrap {
  342. .positioned-properties {
  343. @apply relative top-4;
  344. }
  345. }
  346. }
  347. &[data-has-heading="2"], &:has(textarea.h2) {
  348. > .block-control-wrap {
  349. @apply relative top-3;
  350. }
  351. .block-content-or-editor-wrap {
  352. .positioned-properties {
  353. @apply relative top-3;
  354. }
  355. }
  356. }
  357. &[data-has-heading="3"], &:has(textarea.h3) {
  358. > .block-control-wrap {
  359. @apply relative top-[2px];
  360. }
  361. .block-content-or-editor-wrap {
  362. .positioned-properties {
  363. @apply relative top-[3px];
  364. }
  365. }
  366. }
  367. &[data-has-heading="5"] {
  368. > .block-control-wrap {
  369. @apply relative -top-[1px];
  370. }
  371. }
  372. &[data-has-heading="6"], &:has(textarea.h6) {
  373. h6.as-heading, textarea.h6 {
  374. @apply pt-1;
  375. }
  376. }
  377. }
  378. .ls-block {
  379. @apply relative py-0.5 transition-[background-color] mx-auto;
  380. &.selected {
  381. @apply rounded;
  382. }
  383. }
  384. .ls-block h1,
  385. .editor-inner .h1.uniline-block {
  386. font-size: 2em;
  387. min-height: 1.5em;
  388. }
  389. .ls-block h2,
  390. .editor-inner .h2.uniline-block {
  391. font-size: 1.5em;
  392. min-height: 1.5em;
  393. }
  394. .ls-block h3,
  395. .editor-inner .h3.uniline-block {
  396. font-size: 1.2em;
  397. min-height: 1.2em;
  398. }
  399. .ls-block h4,
  400. .editor-inner .h4.uniline-block {
  401. font-size: 1em;
  402. min-height: 1em;
  403. }
  404. .ls-block h5,
  405. .editor-inner .h5.uniline-block {
  406. font-size: 0.83em;
  407. min-height: 0.83em;
  408. }
  409. .ls-block h6,
  410. .editor-inner .h6.uniline-block {
  411. font-size: 0.75em;
  412. min-height: 0.75em;
  413. }
  414. .ls-block :is(h1, h2, h3, h4, h5, h6),
  415. .editor-inner .uniline-block:is(.h1, .h2, .h3, .h4, .h5, .h6),
  416. .editor-inner .multiline-block:is(.h1, .h2, .h3, .h4, .h5, .h6)::first-line {
  417. font-weight: 600;
  418. }
  419. .ls-block :is(h1, h2),
  420. .editor-inner .uniline-block:is(.h1, .h2) {
  421. @apply border-b border-gray-06 mt-1 mb-2 pb-1;
  422. }
  423. .block-ref .ls-block :is(h1, h2),
  424. .block-ref .editor-inner :is(.h1, .h2) {
  425. border-bottom: none;
  426. }
  427. .block-ref :is(h1, h2, h3, h4, h5, h6) {
  428. border-bottom: none;
  429. font-size: 1rem;
  430. }
  431. .document-mode {
  432. & .ls-block h1,
  433. & .editor-inner .h1 {
  434. margin: 0.67em 0;
  435. }
  436. & .ls-block h2,
  437. & .editor-inner .h2 {
  438. margin: 0.75em 0;
  439. }
  440. & .ls-block h3,
  441. & .editor-inner .h3 {
  442. margin: 0.83em 0;
  443. }
  444. & .ls-block h4,
  445. & .editor-inner .h4 {
  446. margin: 1.12em 0;
  447. }
  448. & .ls-block h5,
  449. & .editor-inner .h5 {
  450. margin: 1.5em 0;
  451. }
  452. & .ls-block h6,
  453. & .editor-inner .h6 {
  454. margin: 1.67em 0;
  455. }
  456. }
  457. .color-level {
  458. background-color: var(--lx-gray-02, var(--color-level-1, var(--rx-gray-02)));
  459. .dark & {
  460. background-color: var(--lx-gray-01, var(--color-level-1, var(--rx-gray-01)));
  461. }
  462. & .color-level {
  463. background-color: var(--color-level-2);
  464. & .color-level {
  465. background-color: var(--color-level-3);
  466. & .color-level {
  467. background-color: var(--color-level-4);
  468. & .color-level {
  469. background-color: var(--color-level-5);
  470. & .color-level {
  471. background-color: var(--color-level-6);
  472. & .color-level {
  473. background-color: var(--color-level-4);
  474. & .color-level {
  475. background-color: var(--color-level-5);
  476. & .color-level {
  477. background-color: var(--color-level-6);
  478. & .color-level {
  479. background-color: var(--color-level-4);
  480. & .color-level {
  481. background-color: var(--color-level-6);
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. .color-level-1 {
  494. background-color: var(--color-level-1);
  495. }
  496. .color-level-2 {
  497. background-color: var(--color-level-2);
  498. }
  499. .color-level-3 {
  500. background-color: var(--color-level-3);
  501. }
  502. .color-level-4 {
  503. background-color: var(--color-level-4);
  504. }
  505. .color-level-5 {
  506. background-color: var(--color-level-5);
  507. }
  508. .color-level-6 {
  509. background-color: var(--color-level-6);
  510. }
  511. .bullet-container {
  512. display: flex;
  513. height: 16px;
  514. width: 16px;
  515. border-radius: 50%;
  516. justify-content: center;
  517. align-items: center;
  518. .bullet-heading {
  519. background-color: var(--ls-block-bullet-color, #8fbc8f);
  520. }
  521. &.as-order-list {
  522. @apply w-[22px] whitespace-nowrap justify-center pl-[3px];
  523. }
  524. .bullet {
  525. @apply rounded-full w-[6px] h-[6px] text-[15px] opacity-80;
  526. > * {
  527. @apply cursor-pointer;
  528. }
  529. }
  530. &:not(.typed-list) {
  531. &.bullet-closed {
  532. background-color: var(--lx-gray-04-alpha, var(--ls-block-bullet-border-color, var(--rx-gray-04-alpha)));
  533. }
  534. .bullet {
  535. background-color: var(--lx-gray-08, var(--ls-block-bullet-color, var(--rx-gray-08)));
  536. transition: transform 0.2s;
  537. }
  538. }
  539. &.typed-list:not(:focus-within) {
  540. .bullet {
  541. background-color: unset;
  542. height: unset;
  543. width: unset;
  544. box-shadow: none;
  545. }
  546. }
  547. }
  548. .bullet-link-wrap {
  549. color: var(--ls-primary-text-color);
  550. .ui__icon {
  551. @apply opacity-80;
  552. }
  553. &:hover > .bullet-container:not(.typed-list) {
  554. background-color: var(--lx-gray-04-alpha, var(--ls-block-bullet-border-color, var(--rx-gray-04-alpha)));
  555. .bullet {
  556. transform: scale(1.2);
  557. background-color: var(--lx-gray-08, var(--ls-block-bullet-color, var(--rx-gray-08))) !important;
  558. }
  559. }
  560. }
  561. .content.doc-mode {
  562. margin-left: -16px;
  563. .block-children-left-border {
  564. display: none;
  565. }
  566. .block-children {
  567. border-left: none;
  568. }
  569. .hide-inner-bullet .bullet {
  570. display: none;
  571. }
  572. .block-children-container {
  573. margin-left: 18px;
  574. }
  575. }
  576. .ls-block .custom-query {
  577. > .th {
  578. @apply flex flex-row flex-1 items-center justify-between my-1 text-xs opacity-90;
  579. }
  580. }
  581. /* copied from https://github.com/drdogbot7/tailwindcss-responsive-embed */
  582. .embed-responsive {
  583. position: relative;
  584. display: block;
  585. height: 0;
  586. padding: 0;
  587. overflow: hidden;
  588. .embed-responsive-item,
  589. iframe,
  590. embed,
  591. object,
  592. video {
  593. position: absolute;
  594. top: 0;
  595. left: 0;
  596. bottom: 0;
  597. height: 100%;
  598. width: 100%;
  599. border: 0;
  600. }
  601. }
  602. .embed {
  603. border-radius: var(--ls-border-radius-low);
  604. }
  605. .embed-header {
  606. font-weight: 600;
  607. }
  608. a.filter svg {
  609. transform: scale(0.9);
  610. }
  611. .table-query-properties svg {
  612. display: inline;
  613. }
  614. .query-title {
  615. background: var(--ls-page-properties-background-color);
  616. }
  617. .ls-card {
  618. height: 100%;
  619. }
  620. .ls-card a[data-ref="card"], .ls-card .page-reference[data-ref="card"] {
  621. display: none;
  622. }
  623. a.cloze {
  624. color: var(--ls-cloze-text-color);
  625. }
  626. a.cloze-revealed {
  627. color: var(--ls-cloze-text-color);
  628. text-decoration: underline;
  629. text-underline-position: under;
  630. }
  631. .page-property-key {
  632. @apply font-medium whitespace-nowrap;
  633. color: var(--ls-secondary-text-color);
  634. }
  635. .page-property-key:hover {
  636. background-color: var(--ls-selection-background-color);
  637. }
  638. .cp__fenced-code-block {
  639. .not-edit {
  640. cursor: default;
  641. }
  642. }
  643. html.is-native-ios {
  644. audio {
  645. width: 100%;
  646. max-width: 350px;
  647. }
  648. }
  649. html:not(.is-mac) {
  650. body[data-active-keystroke="Control"] {
  651. .block-content {
  652. cursor: pointer;
  653. }
  654. }
  655. }
  656. html.is-mac {
  657. body[data-active-keystroke="Meta"] {
  658. .block-content {
  659. cursor: pointer;
  660. }
  661. }
  662. }
  663. .references-blocks {
  664. @apply mb-3;
  665. &-wrap {
  666. .foldable-title {
  667. @apply ml-3;
  668. .block-control {
  669. @apply relative right-[-5px] top-[1px];
  670. }
  671. }
  672. }
  673. &-item {
  674. @apply bg-gray-03 rounded p-4;
  675. > .only-page-blocks {
  676. @apply relative -left-[11px];
  677. }
  678. .with-foldable-page {
  679. > .preview-ref-link {
  680. .page-ref .ui__icon.ti {
  681. @apply top-[2px] left-0;
  682. }
  683. }
  684. }
  685. }
  686. .page-reference:hover {
  687. background: var(--lx-accent-04-alpha, var(--ls-tertiary-background-color, hsl(var(--primary)/.4)));
  688. }
  689. }
  690. .cp__right-sidebar-inner {
  691. .references-blocks-item {
  692. @apply bg-gray-04;
  693. }
  694. }
  695. .block-title-wrap a.tag, .block-body a.tag {
  696. font-size: initial;
  697. opacity: 1;
  698. }
  699. .positioned-properties.right-align {
  700. button {
  701. white-space: nowrap;
  702. }
  703. .block-title-wrap {
  704. @apply overflow-hidden h-6;
  705. white-space: nowrap;
  706. text-overflow: ellipsis;
  707. }
  708. }
  709. .block-tags {
  710. @apply flex flex-row flex-wrap self-start items-center;
  711. min-height: 24px;
  712. max-width: 256px;
  713. margin-right: -28px;
  714. }
  715. .block-tag {
  716. @apply pr-1 flex flex-row items-center gap-1;
  717. }
  718. .block-tag a.tag {
  719. @apply flex text-sm items-center opacity-70;
  720. }
  721. .block-tag a.tag:hover {
  722. @apply opacity-100;
  723. }
  724. .block-tag span {
  725. @apply whitespace-nowrap overflow-hidden;
  726. max-width: 160px;
  727. text-overflow: ellipsis;
  728. }
  729. .ls-table a.tag {
  730. @apply text-sm;
  731. }
  732. .block-content-wrapper svg, .view-actions svg {
  733. width: 18px;
  734. height: 18px;
  735. }
  736. .ls-page-title .ls-page-icon svg, .ls-page-title .ls-page-icon button {
  737. width: 38px;
  738. height: 38px;
  739. }
  740. .ls-page-title .positioned-properties svg {
  741. width: 24px;
  742. height: 24px;
  743. }
  744. .ls-page-title .ls-page-icon button {
  745. margin-top: 8px;
  746. }
  747. .ls-page-title .positioned-properties {
  748. height: 54px;
  749. overflow: hidden;
  750. }