page.css 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. :root {
  2. color-scheme: light dark;
  3. --color-blue: #049EF4;
  4. --text-color: #444;
  5. --font-size: 16px;
  6. --line-height: 26px;
  7. --border-style: 1px solid #E8E8E8;
  8. --panel-width: 300px;
  9. --page-padding: 24px;
  10. --max-width: 760px;
  11. --icon-size: 20px;
  12. }
  13. @media (prefers-color-scheme: dark) {
  14. :root {
  15. --text-color: #bbb;
  16. --border-style: 1px solid #444;
  17. }
  18. }
  19. @font-face {
  20. font-family: 'Roboto Mono';
  21. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
  22. font-style: normal;
  23. font-weight: 400;
  24. }
  25. @font-face {
  26. font-family: 'Inter';
  27. font-style: normal;
  28. font-weight: 400;
  29. src: local('Inter-Regular'), url("../files/Inter-Regular.woff2?v=3.6") format("woff2");
  30. }
  31. @font-face {
  32. font-family: 'Inter';
  33. font-style: normal;
  34. font-weight: 600;
  35. src: local('Inter-SemiBold'), url("../files/Inter-SemiBold.woff2?v=3.6") format("woff2");
  36. }
  37. html {
  38. font-family: 'Inter', sans-serif;
  39. font-size: var(--font-size);
  40. line-height: var(--line-height);
  41. }
  42. body {
  43. color: var(--text-color);
  44. tab-size: 4;
  45. overflow: auto;
  46. max-width: var(--max-width);
  47. margin: 0 auto;
  48. padding-top: var(--page-padding);
  49. padding-bottom: var(--page-padding);
  50. padding-right: var(--page-padding);
  51. padding-left: calc(var(--page-padding) + var(--panel-width));
  52. word-break: break-word;
  53. }
  54. a {
  55. color: var(--color-blue);
  56. cursor: pointer;
  57. text-decoration: none;
  58. }
  59. h1 {
  60. font-size: 40px;
  61. line-height: 48px;
  62. font-weight: normal;
  63. margin-left: -2px;
  64. margin-top: 16px;
  65. margin-bottom: -8px;
  66. }
  67. h2 {
  68. font-size: 28px;
  69. line-height: 36px;
  70. font-weight: normal;
  71. margin-left: -1px;
  72. margin-top: 28px;
  73. margin-bottom: -8px;
  74. }
  75. h3 {
  76. font-size: 20px;
  77. line-height: 28px;
  78. font-weight: normal;
  79. margin-top: 24px;
  80. margin-bottom: -8px;
  81. }
  82. p,
  83. div,
  84. table,
  85. ol,
  86. ul {
  87. margin-top: 16px;
  88. margin-bottom: 16px;
  89. }
  90. p {
  91. padding-right: 16px;
  92. }
  93. ul, ol {
  94. box-sizing: border-box;
  95. padding-left: 24px;
  96. }
  97. ul li,
  98. ol li {
  99. padding-left: 4px;
  100. margin-bottom: 4px;
  101. }
  102. li ul,
  103. li ol {
  104. margin-top: 4px;
  105. }
  106. code {
  107. font-size: calc(var(--font-size) - 1px);
  108. line-height: calc(var(--line-height) - 1px);
  109. margin: 16px calc(-1 * var(--page-padding));
  110. }
  111. ol code,
  112. ul code {
  113. margin: 16px 0;
  114. }
  115. code.inline {
  116. display: inline-block;
  117. vertical-align: middle;
  118. border-radius: 4px;
  119. padding: 0px 5px;
  120. background: #F5F5F5;
  121. margin: 0;
  122. }
  123. table {
  124. width: 100%;
  125. border-collapse: collapse;
  126. }
  127. .desc {
  128. padding-left: 0px;
  129. }
  130. table th,
  131. table td {
  132. text-align: left;
  133. vertical-align: top;
  134. padding: 8px 6px;
  135. border-bottom: var(--border-style);
  136. }
  137. table th {
  138. text-decoration: none;
  139. }
  140. table th:first-child,
  141. table td:first-child {
  142. padding-left: 0;
  143. }
  144. code:not(.inline) {
  145. display: block;
  146. padding: calc(var(--page-padding) - 6px) var(--page-padding);
  147. white-space: pre-wrap;
  148. overflow: auto;
  149. box-sizing: border-box;
  150. }
  151. iframe {
  152. width: 100%;
  153. height: 420px;
  154. border:0;
  155. }
  156. table code {
  157. padding: 0px;
  158. margin: 0px;
  159. width: auto;
  160. }
  161. strong {
  162. font-weight: 600;
  163. }
  164. /* TODO: Duplicate styles in main.css. Needed here cause button is inside the iframe */
  165. #button {
  166. position: fixed;
  167. bottom: 16px;
  168. right: 16px;
  169. padding: 12px;
  170. border-radius: 50%;
  171. margin-bottom: 0px;
  172. background-color: #FFF;
  173. opacity: .9;
  174. z-index: 999;
  175. box-shadow: 0 0 4px rgba(0,0,0,.15);
  176. }
  177. #button:hover {
  178. cursor: pointer;
  179. opacity: 1;
  180. }
  181. #button img {
  182. display: block;
  183. width: var(--icon-size);
  184. }
  185. a.permalink {
  186. float: right;
  187. margin-left: 5px;
  188. display: none;
  189. }
  190. a.param,
  191. span.param {
  192. color: #999;
  193. }
  194. a.param:hover {
  195. color: var(--text-color);
  196. }
  197. @media all and ( min-width: 1700px ) {
  198. :root {
  199. --panel-width: 360px;
  200. --font-size: 18px;
  201. --line-height: 28px;
  202. --max-width: 880px;
  203. --page-padding: 28px;
  204. --icon-size: 24px;
  205. }
  206. h1 {
  207. font-size: 42px;
  208. line-height: 50px;
  209. }
  210. h2 {
  211. font-size: 32px;
  212. line-height: 40px;
  213. }
  214. h3 {
  215. font-size: 24px;
  216. line-height: 32px;
  217. }
  218. }
  219. /* mobile */
  220. @media all and ( max-width: 640px ) {
  221. :root {
  222. --page-padding: 16px;
  223. --icon-size: 24px;
  224. }
  225. body {
  226. padding: var(--page-padding);
  227. }
  228. h1 {
  229. font-size: 28px;
  230. line-height: 36px;
  231. padding-right: 20px;
  232. margin-top: 0;
  233. }
  234. h2 {
  235. font-size: 24px;
  236. line-height: 32px;
  237. margin-top: 24px;
  238. }
  239. h3 {
  240. font-size: 20px;
  241. line-height: 28px;
  242. }
  243. }