sidebar.css 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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: var(--ls-primary-background-color, #fff);
  9. position: relative;
  10. }
  11. #root {
  12. > div {
  13. color: var(--ls-primary-text-color, #24292e);
  14. font-size: var(--ls-page-text-size);
  15. }
  16. }
  17. .is-electron.is-mac .cp__sidebar-left-layout {
  18. }
  19. #app-container {
  20. display: flex;
  21. flex: 0 0 100%;
  22. }
  23. #skip-to-main {
  24. @apply fixed p-2 rounded;
  25. left: 50%;
  26. transform: translate(-50%, 0);
  27. background-color: var(--ls-secondary-background-color);
  28. top: -100px;
  29. z-index: 10000;
  30. transition: top 0.3s;
  31. &:focus {
  32. top: 20px;
  33. }
  34. }
  35. #left-container {
  36. @apply flex flex-1 flex-col relative h-screen;
  37. }
  38. #main-container {
  39. /* Hack: (overflow-y) to fix sticky header not working */
  40. /* To reproduce: quick creating blocks */
  41. overflow-y: hidden;
  42. position: relative;
  43. height: 100%;
  44. transition: padding-left .3s;
  45. &.is-left-sidebar-open {
  46. padding-left: 0;
  47. @screen sm {
  48. padding-left: var(--ls-left-sidebar-width);
  49. }
  50. }
  51. }
  52. #main-content {
  53. position: relative;
  54. height: calc(100vh - var(--ls-headbar-height));
  55. &-container {
  56. @apply p-4 sm:px-8;
  57. font-size: 1em;
  58. }
  59. }
  60. .left-sidebar-inner {
  61. position: relative;
  62. height: 100%;
  63. padding-top: 12px;
  64. width: var(--ls-left-sidebar-sm-width);
  65. overflow-x: hidden;
  66. overflow-y: auto;
  67. background-color: var(--ls-primary-background-color);
  68. transition: transform .3s;
  69. transform: translateX(-100%);
  70. z-index: 3;
  71. -webkit-font-smoothing: antialiased;
  72. > .wrap {
  73. height: calc(100vh - var(--ls-headbar-inner-top-padding) - 50px);
  74. margin-top: 40px;
  75. padding-bottom: 60px;
  76. overflow-y: auto;
  77. }
  78. .dropdown-wrapper {
  79. min-width: 180px;
  80. }
  81. .page-icon {
  82. @apply mr-1 align-baseline;
  83. width: 16px;
  84. height: 16px;
  85. text-align: center;
  86. display: inline-block;
  87. line-height: 1em;
  88. color: var(--ls-icon-color);
  89. }
  90. a.item {
  91. user-select: none;
  92. transition: background-color .3s;
  93. > .ti {
  94. font-size: 16px;
  95. margin-right: 8px;
  96. opacity: .6;
  97. position: relative;
  98. }
  99. &.active, &:active {
  100. background-color: var(--ls-quaternary-background-color);
  101. }
  102. &:hover {
  103. opacity: .8;
  104. .ti {
  105. opacity: .8;
  106. }
  107. }
  108. }
  109. .nav-content-item {
  110. &-inner {
  111. border-radius: 8px;
  112. }
  113. .header {
  114. @apply px-6 py-1;
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. user-select: none;
  119. cursor: pointer;
  120. > span {
  121. > a {
  122. opacity: .4;
  123. padding-left: 12px;
  124. display: none;
  125. transition: none;
  126. &:hover {
  127. opacity: 1 !important;
  128. }
  129. &:last-child {
  130. transform: translateY(-6px) translateX(2px) rotate(90deg);
  131. transform-origin: center center;
  132. transition: .15s transform;
  133. }
  134. }
  135. }
  136. &:hover {
  137. background-color: var(--ls-tertiary-background-color);
  138. * {
  139. opacity: 1 !important;
  140. }
  141. > span {
  142. > a {
  143. display: block;
  144. &:last-child {
  145. display: block;
  146. opacity: .6;
  147. }
  148. }
  149. }
  150. }
  151. &:active {
  152. opacity: .8;
  153. }
  154. .wrap-th {
  155. > span {
  156. font-size: 11px;
  157. font-weight: 600;
  158. }
  159. }
  160. }
  161. .bd {
  162. display: none;
  163. ul {
  164. list-style: none;
  165. padding: 0;
  166. margin: 0;
  167. a {
  168. width: 100%;
  169. padding: 2px 24px;
  170. display: block;
  171. text-overflow: ellipsis;
  172. overflow: hidden;
  173. white-space: nowrap;
  174. color: var(--ls-primary-text-color);
  175. transition: background-color .3s;
  176. &:hover {
  177. background-color: var(--ls-quaternary-background-color);
  178. }
  179. &:active {
  180. opacity: .7;
  181. }
  182. }
  183. }
  184. }
  185. &.is-expand {
  186. .header > span > a {
  187. &:last-child {
  188. transform: translateY(2px) translateX(-3px);
  189. }
  190. }
  191. .bd {
  192. display: block;
  193. }
  194. }
  195. }
  196. .new-page {
  197. position: absolute;
  198. bottom: 0;
  199. left: 0;
  200. width: 100%;
  201. padding: 14px;
  202. &-link {
  203. background-color: var(--ls-primary-background-color);
  204. box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  205. }
  206. }
  207. @screen sm {
  208. padding-top: 0;
  209. width: var(--ls-left-sidebar-width);
  210. background-color: var(--ls-secondary-background-color);
  211. > .wrap {
  212. margin-top: 52px;
  213. }
  214. .new-page {
  215. &-link {
  216. background-color: var(--ls-primary-background-color);
  217. }
  218. }
  219. }
  220. }
  221. .cp__sidebar-left-layout {
  222. position: fixed;
  223. width: 0;
  224. top: var(--ls-headbar-inner-top-padding);
  225. left: 0;
  226. z-index: 9;
  227. transition: width 1.2s;
  228. a {
  229. color: var(--ls-primary-text-color);
  230. }
  231. > .shade-mask {
  232. background-color: rgba(0, 0, 0, .5);
  233. position: absolute;
  234. top: 0;
  235. left: 0;
  236. bottom: 0;
  237. right: 0;
  238. z-index: -1;
  239. opacity: 0;
  240. transition: opacity .1s;
  241. touch-action: none;
  242. }
  243. &.is-open {
  244. transition: none;
  245. width: 100%;
  246. .left-sidebar-inner {
  247. transform: translateX(0);
  248. }
  249. > .shade-mask {
  250. opacity: 1;
  251. z-index: 1;
  252. }
  253. }
  254. &:before {
  255. content: " ";
  256. height: 3rem;
  257. background-color: var(--ls-primary-background-color);
  258. position: fixed;
  259. left: 0;
  260. top: 0;
  261. opacity: 1;
  262. z-index: 5;
  263. }
  264. @screen sm {
  265. width: 0;
  266. &:before {
  267. background-color: var(--ls-secondary-background-color);
  268. width: 0;
  269. overflow: hidden;
  270. }
  271. &.is-open {
  272. width: var(--ls-left-sidebar-width);
  273. }
  274. > .shade-mask {
  275. display: none;
  276. }
  277. }
  278. }
  279. .ls-left-sidebar-open {
  280. .cp__header > .r {
  281. display: none;
  282. }
  283. @screen sm {
  284. .cp__header > .r {
  285. display: flex;
  286. }
  287. }
  288. }
  289. .ls-wide-mode {
  290. .cp__sidebar-main-content {
  291. max-width: var(--ls-main-content-max-width-wide);
  292. }
  293. }
  294. html[data-theme='dark'] {
  295. #left-sidebar {
  296. > .shade-mask {
  297. background-color: rgba(0, 0, 0, .15);
  298. }
  299. }
  300. }
  301. .settings-modal {
  302. margin: -15px;
  303. }
  304. .cp__sidebar-main-layout {
  305. background-color: var(--ls-primary-background-color);
  306. }
  307. .cp__sidebar-main-content {
  308. width: 100%;
  309. max-width: var(--ls-main-content-max-width);
  310. flex: 1;
  311. h1.title {
  312. padding-right: 15px;
  313. }
  314. }
  315. .cp__sidebar-help {
  316. &-docs {
  317. @apply ml-2 mt-1;
  318. td {
  319. word-break: break-all;
  320. }
  321. th {
  322. width: 80%;
  323. }
  324. }
  325. &-btn {
  326. @apply fixed bottom-4 right-8;
  327. > .inner {
  328. @apply font-bold
  329. rounded-full h-8 w-8 flex items-center justify-center font-bold
  330. opacity-70 hover:opacity-100 select-none cursor-help;
  331. background-color: var(--ls-secondary-background-color);
  332. }
  333. }
  334. }
  335. .cp__right-sidebar {
  336. z-index: var(--ls-z-index-level-1);
  337. transition: width 0.3s;
  338. background-color: var(--ls-secondary-background-color, #d8e1e8);
  339. &.closed {
  340. width: 0 !important;
  341. }
  342. &.open {
  343. width: var(--ls-right-sidebar-width);
  344. max-width: 60vw;
  345. }
  346. &-scollable {
  347. min-height: 100%;
  348. overflow-y: scroll;
  349. }
  350. &-inner {
  351. padding-top: 0;
  352. position: relative;
  353. .resizer {
  354. position: absolute;
  355. top: 0;
  356. bottom: 0;
  357. left: 0;
  358. width: 4px;
  359. user-select: none;
  360. cursor: col-resize !important;
  361. }
  362. }
  363. &-settings {
  364. @apply flex flex-row;
  365. margin-bottom: 0;
  366. margin-top: 0;
  367. overflow: auto;
  368. &-btn {
  369. display: block;
  370. white-space: nowrap;
  371. }
  372. }
  373. &-topbar {
  374. position: sticky;
  375. position: -webkit-sticky;
  376. top: 0;
  377. left: 0;
  378. right: 0;
  379. background-color: var(--ls-secondary-background-color, #d8e1e8);
  380. z-index: 999;
  381. user-select: none;
  382. -webkit-app-region: drag;
  383. a, svg {
  384. -webkit-app-region: no-drag;
  385. }
  386. }
  387. .page {
  388. margin-top: 0;
  389. }
  390. .non-block-editor textarea,
  391. pre,
  392. pre.code {
  393. margin: 0;
  394. padding: 0;
  395. font-size: 90%;
  396. background: none;
  397. }
  398. .references {
  399. margin-left: 12px;
  400. }
  401. .sidebar-item {
  402. @apply p-4;
  403. .close {
  404. transform: scale(0.8);
  405. transition: transform 0.1s;
  406. &:hover {
  407. transform: scale(1);
  408. }
  409. }
  410. }
  411. }
  412. .cp__sidebar-main-content[data-is-full-width='true'] {
  413. max-width: 100vw;
  414. }
  415. .cp__sidebar-main-content[data-is-global-graph-pages='true'] {
  416. padding: 0;
  417. }
  418. @supports not (overflow-y: overlay) {
  419. .scrollbar-spacing {
  420. overflow-y: auto;
  421. }
  422. }
  423. @supports (overflow-y: overlay) {
  424. .scrollbar-spacing {
  425. overflow-y: overlay;
  426. }
  427. }
  428. .favorites li.dragging-target {
  429. border-left: 5px solid green;
  430. }
  431. .full-height-without-header {
  432. height: calc(100vh - var(--ls-headbar-height) - 4rem);
  433. }