page.css 4.3 KB

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