block.css 13 KB

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