_layout.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. .row {
  2. max-width: 1400px;
  3. margin: auto;
  4. @media (max-width: 1570px) {
  5. padding: 0 var(--milli);
  6. }
  7. }
  8. .content-wrapper {
  9. display: flex;
  10. justify-content: center;
  11. padding-top: var(--nav-height);
  12. @media(max-width: 800px) {
  13. padding-top: calc(var(--nav-height) + var(--xx-small));
  14. }
  15. @media(max-width: 380px) {
  16. padding-top: calc(var(--nav-height) + var(--medium));
  17. }
  18. }
  19. .content {
  20. display: flex;
  21. gap: var(--large);
  22. flex-direction: column;
  23. flex: 3;
  24. flex-shrink: 1;
  25. min-height: calc(100vh - 178px);
  26. // https://weblog.west-wind.com/posts/2016/Feb/15/Flexbox-Containers-PRE-tags-and-managing-Overflow
  27. min-width: 0;
  28. max-width: 840px;
  29. padding: var(--xx-small) var(--small);
  30. @media (max-width: 1260px) {
  31. flex: 2.5;
  32. padding: var(--xx-small);
  33. }
  34. @media(max-width: 510px) {
  35. padding: var(--xx-small) var(--milli);
  36. }
  37. @media(max-width: 850px) {
  38. gap: 0;
  39. }
  40. footer {
  41. margin-top: auto;
  42. }
  43. }
  44. .table-container {
  45. overflow-x: auto;
  46. }
  47. table.inline-headings {
  48. th, td {
  49. p {
  50. margin-top: 0.3em;
  51. margin-bottom: 0.3em;
  52. padding-left: 2em;
  53. }
  54. .heading .highlight {
  55. display: inline-block;
  56. }
  57. }
  58. }
  59. .relative {
  60. position: relative;
  61. }
  62. #docsearch {
  63. margin-bottom: 16px;
  64. .DocSearch-Button {
  65. margin: 0 0 16px 0;
  66. width: 100%;
  67. background: var(--card-light);
  68. border: 1px solid var(--divider-light);
  69. border-radius: 8px;
  70. max-width: 230px;
  71. }
  72. .DocSearch-Button-Keys {
  73. @media(max-width: 768px) {
  74. display: flex;
  75. }
  76. }
  77. .DocSearch-Button-Key {
  78. background: var(--card);
  79. color: var(--body);
  80. box-shadow: 1px 1px 0px 0px var(--divider-light);
  81. }
  82. .DocSearch-Button-Placeholder {
  83. font-size: rem(1.6);
  84. font-weight: 300;
  85. @media(max-width: 768px) {
  86. display: initial;
  87. }
  88. }
  89. .DocSearch-Search-Icon {
  90. color: var(--body);
  91. }
  92. }
  93. /*
  94. Theme override for the Algolia Docsearch modal
  95. */
  96. .DocSearch-Modal {
  97. --docsearch-primary-color: #{$purple-v2};
  98. --docsearch-highlight-color: #{$purple-v2};
  99. --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
  100. }
  101. .backdrop {
  102. position: fixed;
  103. height: 100vh;
  104. width: 100vw;
  105. inset: 0;
  106. background: rgba(0, 0, 0, .7);
  107. display: none;
  108. }
  109. .sidebar-wrapper {
  110. flex: 1;
  111. @media(max-width: 850px) {
  112. position: fixed;
  113. background: var(--bg);
  114. z-index: 100;
  115. top: var(--nav-height);
  116. left: 0;
  117. border-right: 1px solid var(--divider-light);
  118. transform: translateX(-100%);
  119. transition: all .2s ease-out;
  120. visibility: hidden;
  121. .close-topics {
  122. opacity: 0;
  123. pointer-events: none;
  124. }
  125. &.shown {
  126. transform: none;
  127. visibility: visible;
  128. .close-topics {
  129. opacity: 1;
  130. pointer-events: initial;
  131. }
  132. }
  133. }
  134. }
  135. .sidebar {
  136. margin-left: auto;
  137. position: sticky;
  138. top: var(--nav-height);
  139. padding: var(--xx-small) var(--small);
  140. overflow-y: auto;
  141. height: 100vh;
  142. display: flex;
  143. font-size: rem(1.3);
  144. overflow-x: hidden;
  145. &,
  146. ul {
  147. width: 100%;
  148. min-width: 200px;
  149. max-width: 285px;
  150. @media(max-width: 850px) {
  151. min-width: 260px;
  152. }
  153. }
  154. @media (max-width: 1570px) {
  155. padding-left: var(--milli);
  156. padding-right: var(--nano);
  157. }
  158. @media(max-width: 850px) {
  159. padding-bottom: var(--large);
  160. }
  161. a {
  162. display: block;
  163. cursor: pointer;
  164. position: relative;
  165. padding: 3px 0 3px 15px;
  166. margin-left: 5px;
  167. text-decoration: none;
  168. word-wrap: break-word;
  169. white-space: initial;
  170. &.active {
  171. font-weight: 500;
  172. }
  173. &:hover,
  174. &.active {
  175. color: var(--highlight);
  176. text-decoration: none;
  177. svg {
  178. color: var(--divider-light);
  179. .darker {
  180. color: var(--highlight);
  181. }
  182. }
  183. }
  184. svg {
  185. position: absolute;
  186. left: -6px;
  187. top: 50%;
  188. margin-top: -18px;
  189. color: var(--divider-light);
  190. .darker {
  191. color: var(--sub);
  192. }
  193. &:hover {
  194. stroke-width: 2;
  195. }
  196. }
  197. }
  198. code {
  199. font-family: "Fira Code", Courier, monospace;
  200. }
  201. .no-children>a,
  202. .level-4 a {
  203. &:hover,
  204. &.active {
  205. border-left: 2px solid var(--highlight);
  206. }
  207. }
  208. ul {
  209. position: relative;
  210. list-style-type: none;
  211. margin-top: 0;
  212. padding-left: 0;
  213. ul ul {
  214. margin-left: rem(0.8);
  215. }
  216. }
  217. li {
  218. position: relative;
  219. }
  220. li.level-1 {
  221. &>a {
  222. font-weight: 500;
  223. color: var(--highlight);
  224. }
  225. &>ul {
  226. margin-bottom: rem(1.5);
  227. }
  228. padding: 4px 0;
  229. border-bottom: 1px solid var(--gray-light);
  230. }
  231. li.level-1,
  232. li.level-2,
  233. li.level-3 {
  234. >ul {
  235. display: none;
  236. padding-top: rem(0.5);
  237. margin-bottom: rem(0.625);
  238. padding-left: rem(0.8);
  239. &:before,
  240. &:after {
  241. content: "";
  242. width: 10px;
  243. height: 10px;
  244. position: absolute;
  245. top: 1px;
  246. left: 0px;
  247. }
  248. &:after {
  249. bottom: -10px;
  250. top: unset;
  251. transform: scaleY(-1);
  252. }
  253. }
  254. &.open {
  255. >a {
  256. .hidden-when-open {
  257. visibility: hidden;
  258. }
  259. }
  260. >ul {
  261. display: block;
  262. }
  263. }
  264. }
  265. li.level-1.has-children.open {
  266. padding-bottom: 4px;
  267. }
  268. li.level-2.has-children.open {
  269. padding-bottom: 4px;
  270. }
  271. li.level-3.has-children.open {
  272. padding-bottom: 4px;
  273. }
  274. }
  275. .toc-wrapper {
  276. flex: 1;
  277. position: sticky;
  278. top: 90px;
  279. height: 100vh;
  280. overflow-y: auto;
  281. @media(max-width: 1050px) {
  282. display: none;
  283. }
  284. .btn-ghost {
  285. margin: var(--x-small) var(--milli) var(--milli);
  286. }
  287. }
  288. .toc {
  289. max-width: fit-content;
  290. min-width: 180px;
  291. padding: var(--x-small) rem(2);
  292. position: sticky;
  293. top: 0;
  294. height: 100vh;
  295. overflow-y: auto;
  296. font-size: var(--sm);
  297. padding-bottom: 8.5rem;
  298. &-top {
  299. margin-top: var(--pico);
  300. }
  301. h2 {
  302. font-size: var(--xsm);
  303. letter-spacing: 0.1em;
  304. margin: 0 0 rem(0.75) 0;
  305. padding: 0;
  306. display: inline-block;
  307. color: var(--highlight);
  308. text-transform: uppercase;
  309. }
  310. ul {
  311. list-style-type: none;
  312. margin: 0;
  313. padding: 0;
  314. }
  315. ul ul {
  316. margin-left: var(--milli);
  317. }
  318. li {
  319. padding: rem(0.25) 0;
  320. }
  321. a {
  322. text-decoration: none;
  323. &.active {
  324. &,
  325. code {
  326. font-weight: 500;
  327. }
  328. }
  329. &.active,
  330. &:hover,
  331. &:focus {
  332. &,
  333. code {
  334. color: var(--highlight);
  335. text-decoration: none;
  336. }
  337. }
  338. }
  339. code {
  340. font-family: "Fira Code", Courier, monospace;
  341. font-variant-ligatures: none;
  342. }
  343. }
  344. .sidebar a,
  345. .toc a {
  346. white-space: initial;
  347. }
  348. .footer {
  349. display: flex;
  350. flex-direction: column;
  351. gap: var(--x-small);
  352. text-align: center;
  353. margin-top: var(--large);
  354. padding: var(--small) 0 0;
  355. border-top: 1px solid var(--divider-light);
  356. &-links {
  357. display: flex;
  358. justify-content: center;
  359. flex-wrap: wrap;
  360. column-gap: var(--small);
  361. row-gap: var(--milli);
  362. font-size: var(--sm);
  363. }
  364. button {
  365. border-bottom: 1px solid transparent;
  366. }
  367. button:hover,
  368. button:focus {
  369. border-color: var(--important);
  370. }
  371. a:not([class]),
  372. button {
  373. color: var(--sub) !important;
  374. font-weight: 300 !important;
  375. text-decoration: none;
  376. &[href*="https://"] {
  377. border-bottom: none;
  378. &::after {
  379. display: none;
  380. }
  381. }
  382. }
  383. }
  384. .theme-switcher {
  385. display: flex;
  386. justify-content: center;
  387. gap: var(--xx-small);
  388. button {
  389. background: transparent;
  390. border: none;
  391. }
  392. svg {
  393. height: rem(2.2);
  394. width: rem(2.2);
  395. fill: var(--gray-mid);
  396. }
  397. .system.active {
  398. svg {
  399. fill: var(--important);
  400. }
  401. }
  402. .light.active {
  403. svg {
  404. fill: orange;
  405. }
  406. }
  407. .dark.active {
  408. svg {
  409. fill: var(--gray-light);
  410. }
  411. }
  412. }
  413. body.dark {
  414. .theme-switcher {
  415. svg {
  416. fill: var(--gray-dark);
  417. }
  418. }
  419. li.level-2 {
  420. li.level-3 {
  421. ul {
  422. &:before,
  423. &:after {
  424. content: "";
  425. background-image: url("../images/level_three_transition_dark.svg");
  426. }
  427. }
  428. }
  429. ul {
  430. &:before,
  431. &:after {
  432. content: "";
  433. background-image: url("../images/level_three_transition_dark.svg");
  434. }
  435. }
  436. }
  437. }
  438. .banner {
  439. background-color: var(--tip);
  440. padding: var(--pico) var(--milli);
  441. text-align: center;
  442. @media(max-width: 500px) {
  443. padding: var(--pico);
  444. }
  445. a {
  446. color: var(--link);
  447. }
  448. }
  449. /*
  450. Need for subheadings not handled by toc.html.
  451. toc.html manually handles h2, h3 - since we only display h2 and h3
  452. but if a page has other anchors, want to have the padding.
  453. TODO: see about removing scroll logic in toc.html
  454. */
  455. html {
  456. scroll-padding-top: 80px;
  457. }