code-hike.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. [data-theme*='dark'],
  2. .dark {
  3. --ch-0: dark;
  4. --ch-1: #8b949e;
  5. --ch-2: #79c0ff;
  6. --ch-3: #ffcda1;
  7. --ch-4: #f8f8f2;
  8. --ch-5: #bda4ff;
  9. --ch-6: hsl(var(--brand-600));
  10. --ch-7: #569cd6;
  11. --ch-8: hsl(var(--brand-default));
  12. --ch-9: #ffa198;
  13. --ch-10: #f0f6fc;
  14. --ch-11: #490202;
  15. --ch-12: #04260f;
  16. --ch-13: #5a1e02;
  17. --ch-14: #161b22;
  18. --ch-15: #8b949e;
  19. /* --ch-16: hsl(var(--foreground-lighter)); */
  20. --ch-16: #2a2929;
  21. --ch-17: #264f78;
  22. --ch-18: #3794ff;
  23. --ch-19: #ffffff0b;
  24. --ch-20: #6e7681;
  25. --ch-21: #010409;
  26. --ch-22: #30363d;
  27. --ch-23: #f78166;
  28. --ch-24: #6e768166;
  29. --ch-25: #6e76811a;
  30. }
  31. [data-theme='light'],
  32. .light {
  33. --ch-0: light;
  34. --ch-1: #6e7781;
  35. --ch-2: #0550ae;
  36. --ch-3: #953800;
  37. --ch-4: #24292f;
  38. --ch-5: #8250df;
  39. --ch-6: hsl(var(--brand-600));
  40. --ch-7: #cf222e;
  41. --ch-8: hsl(var(--brand-default));
  42. --ch-9: #82071e;
  43. --ch-10: #f6f8fa;
  44. --ch-11: #ffebe9;
  45. --ch-12: #dafbe1;
  46. --ch-13: #ffd8b5;
  47. --ch-14: #eaeef2;
  48. --ch-15: #57606a;
  49. /* --ch-16: hsl(var(--foreground-lighter)); */
  50. --ch-16: #eeeeee;
  51. --ch-17: #add6ff;
  52. --ch-18: #1a85ff;
  53. --ch-19: #fdff0033;
  54. --ch-20: #8c959f;
  55. --ch-21: #f6f8fa;
  56. --ch-22: #d0d7de;
  57. --ch-23: #fd8c73;
  58. --ch-24: #afb8c133;
  59. --ch-25: #eaeef280;
  60. }
  61. .ch-terminal {
  62. font-size: 14px;
  63. height: 100%;
  64. box-sizing: border-box;
  65. background: #1e1e1e;
  66. color: #fafafa;
  67. overflow: hidden;
  68. padding: 0 8px 8px;
  69. font-family: 'Courier New', Courier, monospace;
  70. /* font-family: Ubuntu, Droid Sans, -apple-system, BlinkMacSystemFont, Segoe WPC, Segoe UI, */
  71. /* sans-serif; */
  72. }
  73. .ch-code-wrapper {
  74. background-color: var(--ch-16) !important;
  75. }
  76. .ch-terminal-container .ch-frame-content {
  77. background-color: inherit;
  78. }
  79. .ch-terminal-prompt {
  80. color: #8fa2db;
  81. -webkit-user-select: none;
  82. -moz-user-select: none;
  83. -ms-user-select: none;
  84. user-select: none;
  85. }
  86. .ch-terminal-content {
  87. margin: 0;
  88. }
  89. .ch-terminal-output {
  90. opacity: 0.66;
  91. }
  92. .ch-code-line-number {
  93. -webkit-user-select: none;
  94. -moz-user-select: none;
  95. -ms-user-select: none;
  96. user-select: none;
  97. text-align: right;
  98. display: inline-block;
  99. box-sizing: border-box;
  100. padding-right: 1.5ch;
  101. font-variant-numeric: tabular-nums;
  102. }
  103. .ch-code-scroll-parent {
  104. display: block;
  105. font-weight: 400;
  106. font-size: 14px;
  107. line-height: 19px;
  108. width: 100% !important;
  109. letter-spacing: 0;
  110. border-radius: 0;
  111. background-color: unset;
  112. color: unset;
  113. padding: 0;
  114. box-sizing: content-box;
  115. border: none;
  116. }
  117. .ch-code-scroll-parent ::-moz-selection {
  118. background-color: var(--ch-selection-background);
  119. color: inherit;
  120. }
  121. .ch-code-scroll-parent ::selection {
  122. background-color: var(--ch-selection-background);
  123. color: inherit;
  124. }
  125. .ch-code-button {
  126. position: absolute;
  127. top: 10px;
  128. right: 10px;
  129. width: 1.1em;
  130. height: 1.1em;
  131. cursor: pointer;
  132. }
  133. .ch-no-scroll {
  134. overflow: hidden;
  135. }
  136. .ch-expand-dialog {
  137. height: 100vh;
  138. width: 100vw;
  139. max-width: 900px;
  140. border: 0;
  141. background-color: transparent;
  142. }
  143. .ch-expand-dialog::-webkit-backdrop {
  144. background-color: rgba(0, 0, 0, 0.8);
  145. }
  146. .ch-expand-dialog::backdrop {
  147. background-color: rgba(0, 0, 0, 0.8);
  148. }
  149. .ch-expand-close {
  150. position: absolute;
  151. top: 10px;
  152. right: 10px;
  153. cursor: pointer;
  154. color: #fff;
  155. width: 26px;
  156. height: 26px;
  157. }
  158. .ch-expand-dialog-content {
  159. color: #fff;
  160. position: absolute;
  161. inset: 40px;
  162. overflow: hidden;
  163. border-radius: 8px;
  164. border: 1px solid;
  165. }
  166. .ch-code-browser {
  167. display: flex;
  168. height: 100%;
  169. /* font-family: 'Courier New', Courier, monospace; */
  170. /* font-family: Ubuntu, Droid Sans, -apple-system; */
  171. }
  172. .ch-code-browser-sidebar {
  173. border-right: 1px solid;
  174. min-width: 100px;
  175. padding: 1em 0;
  176. font-size: 0.95rem;
  177. }
  178. .ch-code-browser-content {
  179. overflow: auto;
  180. flex: 1;
  181. padding: 1em;
  182. white-space: pre;
  183. font-family: monospace;
  184. font-weight: 400;
  185. font-size: 1rem;
  186. line-height: 1.2rem;
  187. letter-spacing: 0;
  188. position: relative;
  189. }
  190. .ch-code-browser-content ::-moz-selection {
  191. background-color: var(--ch-selection-background);
  192. color: inherit;
  193. }
  194. .ch-code-browser-content ::selection {
  195. background-color: var(--ch-selection-background);
  196. color: inherit;
  197. }
  198. .ch-code-browser-sidebar-file,
  199. .ch-code-browser-sidebar-folder {
  200. padding: 0.1em 1em;
  201. }
  202. .ch-code-browser-sidebar-file {
  203. cursor: pointer;
  204. }
  205. .ch-code-browser-sidebar-file:hover {
  206. background-color: var(--ch-hover-background);
  207. color: var(--ch-hover-foreground);
  208. }
  209. .ch-code-browser-button {
  210. width: 1.5em;
  211. height: 1.5em;
  212. cursor: pointer;
  213. min-width: 1.5em;
  214. min-height: 1.5em;
  215. position: absolute;
  216. right: 0.8em;
  217. top: 0.8em;
  218. }
  219. .ch-editor-tab {
  220. border: none;
  221. border-right: 1px solid var(--ch-16);
  222. min-width: -webkit-fit-content;
  223. min-width: -moz-fit-content;
  224. min-width: fit-content;
  225. flex-shrink: 1;
  226. position: relative;
  227. display: flex;
  228. white-space: nowrap;
  229. cursor: pointer;
  230. height: 100%;
  231. box-sizing: border-box;
  232. padding-left: 15px;
  233. padding-right: 15px;
  234. background-color: var(--ch-21) !important;
  235. color: var(--ch-15);
  236. min-width: 0;
  237. }
  238. .ch-editor-tab-active {
  239. background-color: red;
  240. color: #fff;
  241. min-width: unset;
  242. }
  243. .ch-editor-tab > div {
  244. margin-top: auto;
  245. margin-bottom: auto;
  246. font-size: 12px;
  247. line-height: 1.4em;
  248. text-overflow: ellipsis;
  249. overflow: hidden;
  250. }
  251. .ch-editor-frame {
  252. display: flex;
  253. flex-direction: column;
  254. position: relative;
  255. overflow: hidden;
  256. font-family:
  257. Ubuntu,
  258. Droid Sans,
  259. -apple-system,
  260. BlinkMacSystemFont,
  261. Segoe WPC,
  262. Segoe UI,
  263. sans-serif;
  264. -moz-column-break-inside: avoid;
  265. break-inside: avoid;
  266. --ch-title-bar-height: 32px;
  267. height: 100%;
  268. /* border: 1px solid red; */
  269. }
  270. .ch-editor-frame .ch-frame-title-bar {
  271. background-color: var(--ch-21) !important;
  272. background: var(--ch-21) !important;
  273. }
  274. .ch-editor-terminal {
  275. position: absolute;
  276. overflow: hidden;
  277. bottom: 0;
  278. width: 100%;
  279. background-color: #1e1e1e;
  280. color: #e7e7e7;
  281. border-top: 1px solid hsla(0, 0%, 50.2%, 0.35);
  282. padding: 0 8px;
  283. box-sizing: border-box;
  284. }
  285. .ch-editor-terminal-tab {
  286. text-transform: uppercase;
  287. padding: 4px 10px 3px;
  288. font-size: 11px;
  289. line-height: 24px;
  290. display: flex;
  291. }
  292. .ch-editor-terminal-tab > span {
  293. border-bottom: 1px solid #e7e7e7;
  294. }
  295. .ch-editor-terminal-content {
  296. margin-top: 8px;
  297. height: calc(100% - 40px);
  298. box-sizing: border-box;
  299. }
  300. .ch-editor-terminal-content .ch-terminal {
  301. font-size: 12px;
  302. margin: 0;
  303. }
  304. .ch-editor-button {
  305. width: 1.5em;
  306. height: 1.5em;
  307. cursor: pointer;
  308. min-width: 1.5em;
  309. min-height: 1.5em;
  310. margin-right: 0.8em;
  311. }
  312. .ch-frame {
  313. height: 100%;
  314. display: flex;
  315. flex-direction: column;
  316. }
  317. .ch-frame,
  318. .ch-simple-frame {
  319. font-family:
  320. Ubuntu,
  321. Droid Sans,
  322. -apple-system,
  323. BlinkMacSystemFont,
  324. Segoe WPC,
  325. Segoe UI,
  326. sans-serif;
  327. -moz-column-break-inside: avoid;
  328. break-inside: avoid;
  329. --ch-title-bar-height: 30px;
  330. }
  331. .ch-simple-frame {
  332. border-radius: 6px;
  333. overflow: hidden;
  334. box-shadow:
  335. 0 13px 27px -5px rgba(50, 50, 93, 0.25),
  336. 0 8px 16px -8px rgba(0, 0, 0, 0.3),
  337. 0 -6px 16px -6px rgba(0, 0, 0, 0.025);
  338. }
  339. .ch-frame-content {
  340. background-color: var(--ch-content-background, #fafafa);
  341. flex-grow: 1;
  342. flex-shrink: 1;
  343. flex-basis: 0;
  344. min-height: 0;
  345. }
  346. .ch-frame-zoom {
  347. --ch-frame-zoom: 1;
  348. overflow: auto;
  349. position: relative;
  350. width: calc(100% / var(--ch-frame-zoom));
  351. height: calc(100% / var(--ch-frame-zoom));
  352. transform: scale(var(--ch-frame-zoom));
  353. transform-origin: left top;
  354. }
  355. .ch-frame-title-bar {
  356. font-size: 12px;
  357. width: 100%;
  358. height: var(--ch-title-bar-height);
  359. min-height: var(--ch-title-bar-height);
  360. flex-grow: 0;
  361. flex-shrink: 0;
  362. display: flex;
  363. align-items: center;
  364. background-color: var(--ch-content-background, #252526);
  365. color: #ebebed;
  366. position: relative;
  367. }
  368. .ch-frame-middle-bar {
  369. text-overflow: ellipsis;
  370. overflow: hidden;
  371. white-space: nowrap;
  372. font-size: 1.2em;
  373. }
  374. .ch-frame-left-bar,
  375. .ch-frame-right-bar {
  376. flex-grow: 1;
  377. flex-basis: 1em;
  378. height: 100%;
  379. display: flex;
  380. align-items: center;
  381. width: -webkit-max-content;
  382. width: -moz-max-content;
  383. width: max-content;
  384. }
  385. .ch-frame-buttons {
  386. margin: 0 0.8em;
  387. flex-shrink: 0;
  388. height: 1em;
  389. width: 4.16em;
  390. /* display: flex; */
  391. display: none; /* @mildtomato */
  392. }
  393. .ch-frame-button {
  394. width: 1em;
  395. height: 1em;
  396. border: 0.08em solid;
  397. border-radius: 50%;
  398. display: inline-block;
  399. box-sizing: border-box;
  400. }
  401. .ch-frame-button-space {
  402. width: 0.56em;
  403. }
  404. .ch-frame-button-left {
  405. border-color: #ce5347;
  406. background-color: #ed6b60;
  407. }
  408. .ch-frame-button-middle {
  409. border-color: #d6a243;
  410. background-color: #f5be4f;
  411. }
  412. .ch-frame-button-right {
  413. border-color: #58a942;
  414. background-color: #62c554;
  415. }
  416. .ch-mini-browser {
  417. height: 100%;
  418. }
  419. .ch-mini-browser .ch-frame-content iframe,
  420. .ch-mini-browser .ch-frame-content video {
  421. border: none;
  422. position: absolute;
  423. height: 100%;
  424. width: 100%;
  425. }
  426. .ch-mini-browser .ch-frame-title-bar input {
  427. height: 1.4em;
  428. font-size: 1em;
  429. border-radius: 0.5em;
  430. border: none;
  431. box-shadow: none;
  432. flex: 1;
  433. padding: 0 10px;
  434. color: #544;
  435. min-width: 5px;
  436. width: 5px;
  437. }
  438. .ch-browser-button {
  439. margin: 0 1em;
  440. color: #999;
  441. }
  442. .ch-browser-back-button {
  443. margin-left: 0.2em;
  444. }
  445. .ch-browser-forward-button {
  446. margin-left: 0;
  447. }
  448. .ch-browser-open-button {
  449. color: inherit;
  450. }
  451. .ch-browser-open-icon {
  452. display: block;
  453. }
  454. .ch-spotlight {
  455. display: flex;
  456. gap: 1.1rem;
  457. margin: 1rem 0;
  458. }
  459. .ch-spotlight-tabs {
  460. display: flex;
  461. flex-flow: column;
  462. flex: 1;
  463. gap: 0.5rem;
  464. align-items: stretch;
  465. }
  466. .ch-spotlight-tab {
  467. border-radius: 0.25rem;
  468. margin: 0 -0.5rem;
  469. padding: 0 0.5rem;
  470. border: 1px solid #e3e3e3;
  471. }
  472. .ch-spotlight-tab:hover {
  473. border-color: red;
  474. }
  475. .ch-spotlight-tab[data-selected] {
  476. border-color: red;
  477. }
  478. .ch-spotlight-sticker {
  479. position: -webkit-sticky;
  480. position: sticky;
  481. top: 10vh;
  482. display: flex;
  483. align-self: stretch;
  484. flex-flow: column;
  485. justify-content: center;
  486. width: 420px;
  487. min-height: min(100%, 80vh);
  488. max-height: 80vh;
  489. }
  490. .ch-spotlight-sticker .ch-codeblock,
  491. .ch-spotlight-sticker .ch-codegroup {
  492. width: 100%;
  493. min-width: 100%;
  494. min-height: min(100%, 80vh);
  495. max-height: 80vh;
  496. margin-top: 0;
  497. margin-bottom: 0;
  498. flex: 1;
  499. }
  500. .ch-spotlight-with-preview .ch-spotlight-sticker {
  501. height: 80vh;
  502. gap: 0.5rem;
  503. }
  504. .ch-spotlight-with-preview .ch-spotlight-sticker .ch-codeblock,
  505. .ch-spotlight-with-preview .ch-spotlight-sticker .ch-codegroup {
  506. min-height: 0;
  507. flex: 1;
  508. }
  509. .ch-spotlight-with-preview .ch-spotlight-preview {
  510. height: 280px;
  511. }
  512. .ch-scrollycoding {
  513. display: flex;
  514. position: relative;
  515. margin: 1rem 0;
  516. gap: 1rem;
  517. }
  518. .ch-scrollycoding-content {
  519. box-sizing: border-box;
  520. flex: 1;
  521. }
  522. .ch-scrollycoding-step-content {
  523. border-radius: 8px;
  524. margin: 0 -0.5rem;
  525. padding: 1rem 0.5rem;
  526. border: 1.5px solid transparent;
  527. min-height: 180px;
  528. }
  529. .ch-scrollycoding-step-content[data-selected] {
  530. border-color: #0070f3;
  531. }
  532. .ch-scrollycoding-step-content > :first-child {
  533. margin-top: 0;
  534. }
  535. .ch-scrollycoding-step-content > :last-child {
  536. margin-bottom: 0;
  537. }
  538. .ch-scrollycoding-sticker {
  539. position: -webkit-sticky;
  540. position: sticky;
  541. top: 10vh;
  542. display: flex;
  543. align-self: start;
  544. flex-flow: column;
  545. justify-content: center;
  546. width: var(--ch-scrollycoding-sticker-width, 420px);
  547. max-height: 80vh;
  548. }
  549. .ch-scrollycoding-with-preview .ch-scrollycoding-sticker {
  550. height: 80vh;
  551. gap: 0.5rem;
  552. }
  553. .ch-scrollycoding-with-preview .ch-scrollycoding-sticker .ch-codeblock,
  554. .ch-scrollycoding-with-preview .ch-scrollycoding-sticker .ch-codegroup {
  555. flex: 1;
  556. }
  557. .ch-scrollycoding-with-preview .ch-scrollycoding-preview {
  558. height: 280px;
  559. }
  560. .ch-scrollycoding-sticker .ch-codeblock,
  561. .ch-scrollycoding-sticker .ch-codegroup {
  562. width: 100%;
  563. min-width: 100%;
  564. min-height: var(--ch-scrollycoding-code-min-height, 200px);
  565. max-height: 80vh;
  566. margin-top: 0;
  567. margin-bottom: 0;
  568. }
  569. .ch-scrollycoding-static .ch-preview {
  570. height: 150px;
  571. }
  572. .ch-slideshow {
  573. margin: 1rem 0;
  574. }
  575. .ch-slideshow-slide {
  576. display: flex;
  577. flex-flow: row;
  578. gap: 0.5rem;
  579. align-items: stretch;
  580. aspect-ratio: 16/9;
  581. }
  582. .ch-slideshow-slide .ch-codeblock,
  583. .ch-slideshow-slide .ch-codegroup {
  584. flex: 2;
  585. margin-top: 0;
  586. margin-bottom: 0;
  587. height: auto;
  588. }
  589. .ch-slideshow .ch-slideshow-preview {
  590. flex: 1;
  591. height: auto;
  592. min-width: 0;
  593. }
  594. .ch-slideshow-range {
  595. display: flex;
  596. flex-flow: row;
  597. gap: 0.5rem;
  598. }
  599. .ch-slideshow-range input {
  600. flex: 1;
  601. }
  602. .ch-slideshow-notes {
  603. border-radius: 0.25rem;
  604. margin-top: 1rem;
  605. padding: 1rem;
  606. border: 1px solid #e3e3e3;
  607. }
  608. .ch-slideshow-note {
  609. min-height: 140px;
  610. max-height: 140px;
  611. padding: 0.05px;
  612. overflow: auto;
  613. }
  614. .ch-codeblock,
  615. .ch-codegroup,
  616. .ch-preview {
  617. border-radius: 6px;
  618. overflow: hidden;
  619. height: -webkit-max-content;
  620. height: -moz-max-content;
  621. height: max-content;
  622. /* box-shadow: 0 13px 27px -5px rgba(50, 50, 93, 0.25), 0 8px 16px -8px rgba(0, 0, 0, 0.3), */
  623. /* 0 -6px 16px -6px rgba(0, 0, 0, 0.025); */
  624. -webkit-print-color-adjust: exact;
  625. print-color-adjust: exact;
  626. }
  627. .ch-codeblock > *,
  628. .ch-codegroup > *,
  629. .ch-preview > * {
  630. height: 100%;
  631. max-height: inherit;
  632. min-height: inherit;
  633. }
  634. .ch-codeblock,
  635. .ch-codegroup {
  636. margin-top: 1.25em;
  637. margin-bottom: 1.25em;
  638. border: 1px solid hsl(var(--border-default)); /* @mildtomato */
  639. box-shadow: none;
  640. }
  641. .ch-inline-code > code {
  642. padding: 0.2em 0.15em;
  643. margin: 0.1em -0.05em;
  644. border-radius: 0.25em;
  645. font-size: 0.9rem;
  646. }
  647. .ch-section-link,
  648. .ch-section-link * {
  649. text-decoration: underline;
  650. -webkit-text-decoration-style: dotted;
  651. text-decoration-style: dotted;
  652. text-decoration-thickness: 1px;
  653. -webkit-text-decoration-color: var(--ch-code-foreground, currentColor);
  654. text-decoration-color: var(--ch-code-foreground, currentColor);
  655. }
  656. .ch-section-link[data-active='true'] {
  657. background-color: rgba(186, 230, 253, 0.4);
  658. }
  659. .ch-editor-tab[data-active='true'] {
  660. background-color: var(--ch-16) !important;
  661. }
  662. .ch-section-link[data-active='true'],
  663. .ch-section-link[data-active='true'] * {
  664. text-decoration-thickness: 1.5px;
  665. }
  666. .ch-code-inline-mark {
  667. border-radius: 0.25rem;
  668. padding: 0.2rem 0.15rem 0.1rem;
  669. margin: 0 -0.15rem;
  670. }
  671. .ch-code-multiline-mark-border {
  672. background: var(--foreground-default) !important;
  673. width: 3px;
  674. height: 100%;
  675. position: absolute;
  676. left: 0;
  677. }
  678. .ch-code-inline-link,
  679. .ch-code-link :not(span) > span {
  680. text-decoration: underline;
  681. -webkit-text-decoration-style: dotted;
  682. text-decoration-style: dotted;
  683. color: inherit;
  684. }