page.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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 a {
  55. color: var(--color-blue);
  56. cursor: pointer;
  57. text-decoration: none;
  58. }
  59. body 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. body 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. body h3 {
  76. font-size: 20px;
  77. line-height: 28px;
  78. font-weight: normal;
  79. margin-top: 24px;
  80. margin-bottom: -8px;
  81. }
  82. body p,
  83. body div,
  84. body table,
  85. body ol,
  86. body ul,
  87. body summary {
  88. margin-top: 16px;
  89. margin-bottom: 16px;
  90. }
  91. body summary:hover {
  92. cursor: pointer;
  93. }
  94. body p {
  95. padding-right: 16px;
  96. }
  97. body ul, body ol {
  98. box-sizing: border-box;
  99. padding-left: 24px;
  100. }
  101. body ul li,
  102. body ol li {
  103. padding-left: 4px;
  104. margin-bottom: 4px;
  105. }
  106. body li ul,
  107. body li ol {
  108. margin-top: 4px;
  109. }
  110. body code {
  111. display: inline-block;
  112. vertical-align: middle;
  113. border-radius: 4px;
  114. padding: 0px 5px;
  115. background: #F5F5F5;
  116. }
  117. body pre {
  118. position: relative;
  119. margin: 16px calc(-1 * var(--page-padding));
  120. }
  121. body pre code {
  122. display: block;
  123. font-size: calc(var(--font-size) - 1px);
  124. line-height: calc(var(--line-height) - 1px);
  125. padding: calc(var(--page-padding) - 6px) var(--page-padding);
  126. white-space: pre-wrap;
  127. overflow: auto;
  128. box-sizing: border-box;
  129. background: #F5F5F5;
  130. border-radius: 0;
  131. }
  132. body ol code,
  133. body ul code {
  134. margin: 0;
  135. }
  136. body .copy-btn {
  137. cursor: pointer;
  138. position: absolute;
  139. top: 16px;
  140. right: 16px;
  141. width: 24px;
  142. height: 24px;
  143. background-color: transparent;
  144. background-image: url('/files/ic_copy_grey_24dp.svg');
  145. background-size: contain;
  146. background-position: center;
  147. background-repeat: no-repeat;
  148. opacity: 0.9;
  149. border: none;
  150. }
  151. body .copy-btn:hover {
  152. opacity: 1;
  153. }
  154. body .copy-btn.copied {
  155. pointer-events: none;
  156. opacity: 1;
  157. background-image: url('/files/ic_tick_green_24dp.svg');
  158. }
  159. body table {
  160. width: 100%;
  161. border-collapse: collapse;
  162. }
  163. body .desc {
  164. padding-left: 0px;
  165. }
  166. body table th,
  167. body table td {
  168. text-align: left;
  169. vertical-align: top;
  170. padding: 8px 6px;
  171. border-bottom: var(--border-style);
  172. }
  173. body table th {
  174. text-decoration: none;
  175. }
  176. body table th:first-child,
  177. body table td:first-child {
  178. padding-left: 0;
  179. }
  180. body table code {
  181. padding: 0px;
  182. margin: 0px;
  183. width: auto;
  184. }
  185. body table p {
  186. margin: 0;
  187. }
  188. body strong {
  189. font-weight: 600;
  190. }
  191. body a.param,
  192. body span.param {
  193. color: #999;
  194. }
  195. body a.param:hover {
  196. color: var(--text-color);
  197. }
  198. body .inheritance {
  199. color: #999;
  200. margin-bottom: 0;
  201. font-size: var(--font-size);
  202. line-height: var(--line-height);
  203. margin-top: 0;
  204. }
  205. body .method,
  206. body .member {
  207. margin-bottom: 32px;
  208. }
  209. body ol.linenums {
  210. padding-left: 64px;
  211. }
  212. body ol.linenums .selected {
  213. background-color: #ddd;
  214. }
  215. body h3.name {
  216. color: #000;
  217. }
  218. body h3.name a {
  219. color: var(--color-blue);
  220. text-decoration: none;
  221. }
  222. body h3.name .signature {
  223. color: #000;
  224. font-weight: normal;
  225. }
  226. body h3.name .type-signature {
  227. color: #999;
  228. font-weight: normal;
  229. }
  230. body h3.name .type-signature a {
  231. color: #999;
  232. }
  233. body h3.name .param-type {
  234. color: #999;
  235. }
  236. body h3.name .param-type a {
  237. color: #999;
  238. }
  239. body h2.subsection-title + p {
  240. margin-top: 24px;
  241. }
  242. body iframe#viewer {
  243. width: 100%;
  244. height: 400px;
  245. border: none;
  246. margin-top: 16px;
  247. margin-bottom: 16px;
  248. }
  249. @media (prefers-color-scheme: dark) {
  250. body h2 {
  251. color: var(--text-color);
  252. }
  253. body h3.name {
  254. color: var(--text-color);
  255. }
  256. body h3.name .signature {
  257. color: var(--text-color);
  258. }
  259. body .link-anchor {
  260. color: #555;
  261. }
  262. body ol.linenums .selected {
  263. background-color: #444;
  264. }
  265. body code {
  266. background: #444;
  267. }
  268. body pre code {
  269. background: #444;
  270. }
  271. }
  272. @media all and ( min-width: 1700px ) {
  273. :root {
  274. --panel-width: 360px;
  275. --font-size: 18px;
  276. --line-height: 28px;
  277. --max-width: 880px;
  278. --page-padding: 28px;
  279. --icon-size: 24px;
  280. }
  281. body h1 {
  282. font-size: 42px;
  283. line-height: 50px;
  284. }
  285. body h2 {
  286. font-size: 32px;
  287. line-height: 40px;
  288. }
  289. body h3 {
  290. font-size: 24px;
  291. line-height: 32px;
  292. }
  293. }
  294. /* mobile */
  295. @media all and ( max-width: 640px ) {
  296. :root {
  297. --page-padding: 16px;
  298. --icon-size: 24px;
  299. }
  300. body {
  301. padding: var(--page-padding);
  302. }
  303. body h1 {
  304. font-size: 28px;
  305. line-height: 36px;
  306. padding-right: 20px;
  307. margin-top: 0;
  308. }
  309. body h2 {
  310. font-size: 24px;
  311. line-height: 32px;
  312. margin-top: 24px;
  313. }
  314. body h3 {
  315. font-size: 20px;
  316. line-height: 28px;
  317. }
  318. body .copy-btn {
  319. top: 12px;
  320. right: 8px;
  321. width: 20px;
  322. height: 20px;
  323. }
  324. }
粤ICP备19079148号