lesson.css 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. /* TODO Use ../files/main.css instead */
  2. :root {
  3. color-scheme: light dark;
  4. --color-blue: #049EF4;
  5. --text-color: #444;
  6. --font-size: 16px;
  7. --line-height: 26px;
  8. --border-style: 1px solid #E8E8E8;
  9. --panel-width: 300px;
  10. --page-padding: 24px;
  11. --max-width: 760px;
  12. --icon-size: 20px;
  13. }
  14. @media (prefers-color-scheme: dark) {
  15. :root {
  16. --background-color: #222;
  17. --secondary-background-color: #2e2e2e;
  18. --text-color: #bbb;
  19. --secondary-text-color: #666;
  20. --border-style: 1px solid #444;
  21. }
  22. }
  23. @font-face {
  24. font-family: 'Roboto Mono';
  25. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../../files/RobotoMono-Regular.woff2') format('woff2');
  26. font-style: normal;
  27. font-weight: 400;
  28. }
  29. @font-face {
  30. font-family: 'Inter';
  31. font-style: normal;
  32. font-weight: 400;
  33. src: local('Inter-Regular'), url("../../files/Inter-Regular.woff2?v=3.6") format("woff2");
  34. }
  35. @font-face {
  36. font-family: 'Inter';
  37. font-style: normal;
  38. font-weight: 600;
  39. src: local('Inter-SemiBold'), url("../../files/Inter-SemiBold.woff2?v=3.6") format("woff2");
  40. }
  41. html {
  42. font-family: 'Inter', sans-serif;
  43. font-size: var(--font-size);
  44. line-height: var(--line-height);
  45. }
  46. body {
  47. color: var(--text-color);
  48. tab-size: 4;
  49. overflow: auto;
  50. max-width: var(--max-width);
  51. margin: 0 auto;
  52. padding-top: var(--page-padding);
  53. padding-bottom: var(--page-padding);
  54. padding-right: var(--page-padding);
  55. padding-left: calc(var(--page-padding) + var(--panel-width));
  56. word-break: break-word;
  57. }
  58. a {
  59. color: var(--color-blue);
  60. cursor: pointer;
  61. text-decoration: none;
  62. }
  63. h1 {
  64. font-size: 40px;
  65. line-height: 48px;
  66. font-weight: normal;
  67. margin-left: -2px;
  68. margin-top: 16px;
  69. margin-bottom: -8px;
  70. }
  71. p {
  72. margin-top: 16px;
  73. margin-bottom: 16px;
  74. padding-right: 16px;
  75. }
  76. li > p {
  77. width: calc(100% - 2em);
  78. }
  79. table {
  80. margin-top: 1em;
  81. margin-bottom: 1em;
  82. }
  83. .warning {
  84. padding: 1em;
  85. background: red;
  86. }
  87. .footnote {
  88. font-size: smaller;
  89. vertical-align: baseline;
  90. position: relative;
  91. top: -0.4em;
  92. }
  93. .footnotes {
  94. font-size: smaller;
  95. }
  96. .deep-link {
  97. position: absolute;
  98. transform: translateX(-1em);
  99. }
  100. pre {
  101. background: rgb(143, 140, 140);
  102. padding: 1em;
  103. position: relative;
  104. }
  105. pre>code {
  106. white-space: inherit;
  107. background: none;
  108. }
  109. pre.prettyprint {
  110. margin-top: 2em !important;
  111. margin-bottom: 2em !important;
  112. position: relative;
  113. }
  114. pre.prettyprint li {
  115. white-space: pre;
  116. }
  117. pre.prettyprint code, .dos {
  118. color: #CCC;
  119. font-family: var(--code-block-font-family);
  120. display: block;
  121. }
  122. /* to handle long words in paragraph */
  123. p code {
  124. word-break: break-word;
  125. white-space: normal;
  126. }
  127. div[data-diagram] {
  128. height: 100%;
  129. }
  130. .spread {
  131. display: flex;
  132. text-align: center;
  133. margin: 2em auto 3em;
  134. }
  135. .spread div[data-diagram] {
  136. height: 150px;
  137. }
  138. .spread>div {
  139. flex: 1 1 100%;
  140. }
  141. .spread .code {
  142. font-family: var(--code-font-family);
  143. }
  144. .spread .code>div {
  145. text-align: left;
  146. }
  147. #c {
  148. position: absolute;
  149. top: 0;
  150. left: 0;
  151. width: 100%;
  152. height: 100%;
  153. z-index: -100;
  154. }
  155. .border {
  156. border: 1px solid black;
  157. }
  158. .lesson-comment-notes {
  159. padding: 1em;
  160. margin: 1em;
  161. background: #DDD;
  162. color: red;
  163. }
  164. .threejs_navbar>div,
  165. .lesson-comments,
  166. .lesson-comment-sep,
  167. .lesson-main>h1:not(:first-child),
  168. .lesson-main>h2:not(:first-child),
  169. .lesson-main>h3:not(:first-child),
  170. .lesson-main>h4:not(:first-child),
  171. .lesson-main>h5:not(:first-child),
  172. .lesson-main>h6:not(:first-child) {
  173. margin-top: 1.66em;
  174. }
  175. .lesson-main>.threejs_example_container {
  176. max-width: 90%;
  177. }
  178. .lesson-main>img {
  179. width: unset;
  180. }
  181. .threejs_example {
  182. width: 100%;
  183. height: 500px;
  184. }
  185. .color {
  186. padding: 0.25em;
  187. border-radius: 0.5em;
  188. color: black;
  189. }
  190. .dark-color {
  191. padding: 0.25em;
  192. border-radius: 0.5em;
  193. color: white;
  194. }
  195. .checkerboard {
  196. background-color: #404040;
  197. background-image:
  198. linear-gradient(45deg, #808080 25%, transparent 25%),
  199. linear-gradient(-45deg, #808080 25%, transparent 25%),
  200. linear-gradient(45deg, transparent 75%, #808080 75%),
  201. linear-gradient(-45deg, transparent 75%, #808080 75%);
  202. background-size: 20px 20px;
  203. background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  204. }
  205. .fullscreen {
  206. position: fixed !important;
  207. left: var(--panel-width);
  208. top: 0;
  209. width: calc(100% - var(--panel-width)) !important;
  210. height: 100% !important;
  211. z-index: 100;
  212. }
  213. .lesson-main>blockquote {
  214. background-color: #DEF;
  215. padding: 1em;
  216. }
  217. .lesson-sidebar {
  218. font-size: small;
  219. columns: 220px;
  220. padding: 1em;
  221. column-rule: dashed 1px #CCC;
  222. background: #eee;
  223. margin-bottom: 1em;
  224. }
  225. .lesson-sidebar>ul>li {
  226. line-height: 1.3em;
  227. }
  228. .lesson-sidebar ul {
  229. line-height: 1.3em;
  230. margin-bottom: 1em;
  231. }
  232. .lesson-sidebar ul {
  233. list-style-type: none;
  234. padding-left: 1em;
  235. text-indent: -1em;
  236. }
  237. code {
  238. color: black;
  239. background-color: #ddd;
  240. padding: 0.1em 0.2em 0.1em 0.2em;
  241. white-space: nowrap;
  242. }
  243. .threejs_table_div_center {
  244. text-align: center;
  245. }
  246. .threejs_table_center {
  247. margin-left: auto;
  248. margin-right: auto;
  249. }
  250. .threejs_center {
  251. margin-left: auto;
  252. margin-top: 1em;
  253. margin-bottom: 1em;
  254. margin-right: auto;
  255. display: block;
  256. text-align: center;
  257. max-width: 95%;
  258. }
  259. .threejs_center>img,
  260. .threejs_center>object {
  261. max-width: 100%;
  262. }
  263. .threejs_image>img {
  264. width: 100%;
  265. display: block;
  266. }
  267. .threejs_math {
  268. margin-left: auto;
  269. margin-right: auto;
  270. display: inline-block;
  271. text-align: left;
  272. }
  273. .threejs_math_center {
  274. display: block;
  275. text-align: center;
  276. }
  277. .hcenter {
  278. display: -webkit-box;
  279. -webkit-box-orient: horizontal;
  280. -webkit-box-pack: center;
  281. -webkit-box-align: center;
  282. display: -moz-box;
  283. -moz-box-orient: horizontal;
  284. -moz-box-pack: center;
  285. -moz-box-align: center;
  286. display: box;
  287. box-orient: horizontal;
  288. box-pack: center;
  289. box-align: center;
  290. }
  291. table.vertex_table {
  292. border: 1px solid black;
  293. border-collapse: collapse;
  294. font-family: monospace;
  295. font-size: small;
  296. }
  297. table.vertex_table th {
  298. background-color: #88ccff;
  299. padding-right: 1em;
  300. padding-left: 1em;
  301. }
  302. table.vertex_table td {
  303. border: 1px solid black;
  304. text-align: right;
  305. padding-right: 1em;
  306. padding-left: 1em;
  307. }
  308. iframe {
  309. display: block;
  310. }
  311. iframe.body {
  312. height: 100%;
  313. }
  314. iframe.threejs_example, iframe.threejs_diagram {
  315. border: none;
  316. margin-left: auto;
  317. margin-right: auto;
  318. display: block;
  319. }
  320. iframe.threejs_example {
  321. background: black;
  322. }
  323. iframe.noborder {
  324. border: none !important;
  325. }
  326. .threejs_example_container>div {
  327. border: 1px solid black;
  328. margin: 0 auto;
  329. }
  330. iframe.external_diagram {
  331. border: none;
  332. margin-left: auto;
  333. margin-right: auto;
  334. display: block;
  335. }
  336. div.threejs_bottombar {
  337. background-color: #def;
  338. margin-top: var(--page-padding);
  339. outline: var(--page-padding) solid #def;
  340. }
  341. div.threejs_bottombar>h3 {
  342. font-size: x-large;
  343. font-weight: bold;
  344. margin-bottom: 1em;
  345. }
  346. div.threejs_bottombar code {
  347. background-color: #ccc;
  348. }
  349. .dos {
  350. color: var(--text-color);
  351. line-height: 1;
  352. }
  353. @media (max-width: 720px) {
  354. .threejs_example {
  355. max-height: 400px;
  356. }
  357. .threejs_example_container>div {
  358. max-width: 95%;
  359. }
  360. .threejs_diagram_container iframe {
  361. max-width: 95%;
  362. }
  363. iframe.background {
  364. max-width: 100%;
  365. }
  366. }
  367. @media all and ( min-width: 1700px ) {
  368. :root {
  369. --panel-width: 360px;
  370. --font-size: 18px;
  371. --line-height: 28px;
  372. --max-width: 880px;
  373. --page-padding: 28px;
  374. --icon-size: 24px;
  375. }
  376. h1 {
  377. font-size: 42px;
  378. line-height: 50px;
  379. }
  380. }
  381. @media all and ( max-width: 640px ) {
  382. :root {
  383. --page-padding: 16px;
  384. --icon-size: 24px;
  385. }
  386. body {
  387. padding: var(--page-padding);
  388. }
  389. h1 {
  390. font-size: 28px;
  391. line-height: 36px;
  392. padding-right: 20px;
  393. margin-top: 0;
  394. }
  395. }
  396. @media (prefers-color-scheme: dark) {
  397. html {
  398. scrollbar-color: hsl(0, 0%, 35%) hsl(0, 0%, 13%);
  399. }
  400. .warning {
  401. background: darkred;
  402. }
  403. code {
  404. background: #666;
  405. color: #CCC;
  406. }
  407. img {
  408. background: #DDD;
  409. }
  410. img[src$=".svg"] {
  411. filter: invert(1) hue-rotate(180deg);
  412. background: none;
  413. }
  414. .noinvertdark {
  415. filter: none !important;
  416. }
  417. .nobg {
  418. background: none;
  419. }
  420. .lesson-sidebar {
  421. background: #222;
  422. }
  423. .lesson-main>blockquote {
  424. background-color: #1b1b44;
  425. }
  426. div.threejs_bottombar {
  427. background-color: #1b1b44;
  428. outline: var(--page-padding) solid #1b1b44;
  429. }
  430. div.threejs_bottombar code {
  431. background-color: #348;
  432. }
  433. .lesson-comment-notes {
  434. background: #222;
  435. }
  436. input[type=text] {
  437. background: #444;
  438. color: white;
  439. border: none;
  440. padding: 3px;
  441. }
  442. }