page.css 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. body.rtl h1,
  55. body.rtl h2,
  56. body.rtl h3,
  57. body.rtl h4,
  58. body.rtl p,
  59. body.rtl ul,
  60. body.rtl ol,
  61. body.rtl table {
  62. direction: rtl !important;
  63. }
  64. body.rtl code {
  65. direction: ltr !important;
  66. }
  67. a {
  68. color: var(--color-blue);
  69. cursor: pointer;
  70. text-decoration: none;
  71. }
  72. h1 {
  73. font-size: 40px;
  74. line-height: 48px;
  75. font-weight: normal;
  76. margin-left: -2px;
  77. margin-top: 16px;
  78. margin-bottom: -8px;
  79. }
  80. h2 {
  81. font-size: 28px;
  82. line-height: 36px;
  83. font-weight: normal;
  84. margin-left: -1px;
  85. margin-top: 28px;
  86. margin-bottom: -8px;
  87. }
  88. h3 {
  89. font-size: 20px;
  90. line-height: 28px;
  91. font-weight: normal;
  92. margin-top: 24px;
  93. margin-bottom: -8px;
  94. }
  95. p,
  96. div,
  97. table,
  98. ol,
  99. ul {
  100. margin-top: 16px;
  101. margin-bottom: 16px;
  102. }
  103. p {
  104. padding-right: 16px;
  105. }
  106. ul, ol {
  107. box-sizing: border-box;
  108. padding-left: 24px;
  109. }
  110. ul li,
  111. ol li {
  112. padding-left: 4px;
  113. margin-bottom: 4px;
  114. }
  115. li ul,
  116. li ol {
  117. margin-top: 4px;
  118. }
  119. code {
  120. font-size: calc(var(--font-size) - 1px);
  121. line-height: calc(var(--line-height) - 1px);
  122. margin: 16px calc(-1 * var(--page-padding));
  123. }
  124. ol code,
  125. ul code {
  126. margin: 16px 0;
  127. }
  128. code.inline {
  129. display: inline-block;
  130. vertical-align: middle;
  131. border-radius: 4px;
  132. padding: 0px 5px;
  133. background: #F5F5F5;
  134. margin: 0;
  135. }
  136. table {
  137. width: 100%;
  138. border-collapse: collapse;
  139. }
  140. .desc {
  141. padding-left: 0px;
  142. }
  143. table th,
  144. table td {
  145. text-align: left;
  146. vertical-align: top;
  147. padding: 8px 6px;
  148. border-bottom: var(--border-style);
  149. }
  150. table th {
  151. text-decoration: none;
  152. }
  153. table th:first-child,
  154. table td:first-child {
  155. padding-left: 0;
  156. }
  157. code:not(.inline) {
  158. display: block;
  159. padding: calc(var(--page-padding) - 6px) var(--page-padding);
  160. white-space: pre-wrap;
  161. overflow: auto;
  162. box-sizing: border-box;
  163. }
  164. iframe {
  165. width: 100%;
  166. height: 420px;
  167. border:0;
  168. }
  169. table code {
  170. padding: 0px;
  171. margin: 0px;
  172. width: auto;
  173. }
  174. strong {
  175. font-weight: 600;
  176. }
  177. /* TODO: Duplicate styles in main.css. Needed here cause button is inside the iframe */
  178. #button {
  179. position: fixed;
  180. bottom: 16px;
  181. right: 16px;
  182. padding: 12px;
  183. border-radius: 50%;
  184. margin-bottom: 0px;
  185. background-color: #FFF;
  186. opacity: .9;
  187. z-index: 999;
  188. box-shadow: 0 0 4px rgba(0,0,0,.15);
  189. }
  190. #button:hover {
  191. cursor: pointer;
  192. opacity: 1;
  193. }
  194. #button img {
  195. display: block;
  196. width: var(--icon-size);
  197. }
  198. a.permalink {
  199. float: right;
  200. margin-left: 5px;
  201. display: none;
  202. }
  203. a.param,
  204. span.param {
  205. color: #999;
  206. }
  207. a.param:hover {
  208. color: var(--text-color);
  209. }
  210. @media all and ( min-width: 1700px ) {
  211. :root {
  212. --panel-width: 360px;
  213. --font-size: 18px;
  214. --line-height: 28px;
  215. --max-width: 880px;
  216. --page-padding: 28px;
  217. --icon-size: 24px;
  218. }
  219. h1 {
  220. font-size: 42px;
  221. line-height: 50px;
  222. }
  223. h2 {
  224. font-size: 32px;
  225. line-height: 40px;
  226. }
  227. h3 {
  228. font-size: 24px;
  229. line-height: 32px;
  230. }
  231. }
  232. /* mobile */
  233. @media all and ( max-width: 640px ) {
  234. :root {
  235. --page-padding: 16px;
  236. --icon-size: 24px;
  237. }
  238. body {
  239. padding: var(--page-padding);
  240. }
  241. h1 {
  242. font-size: 28px;
  243. line-height: 36px;
  244. padding-right: 20px;
  245. margin-top: 0;
  246. }
  247. h2 {
  248. font-size: 24px;
  249. line-height: 32px;
  250. margin-top: 24px;
  251. }
  252. h3 {
  253. font-size: 20px;
  254. line-height: 28px;
  255. }
  256. }