page.css 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. @font-face {
  2. font-family: 'Roboto Mono';
  3. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('/files/RobotoMono-Regular.woff2') format('woff2');
  4. font-style: normal;
  5. font-weight: 400;
  6. }
  7. @font-face {
  8. font-family: 'Inter';
  9. font-style: normal;
  10. font-weight: 400;
  11. src: local('Inter-Regular'), url("/files/Inter-Regular.woff2?v=3.6") format("woff2");
  12. }
  13. @font-face {
  14. font-family: 'Inter';
  15. font-style: normal;
  16. font-weight: 600;
  17. src: local('Inter-SemiBold'), url("/files/Inter-SemiBold.woff2?v=3.6") format("woff2");
  18. }
  19. /* Below CSS should only affect the page section */
  20. #page {
  21. --font-size: 16px;
  22. --line-height: 26px;
  23. --panel-width: 300px;
  24. --page-padding: 24px;
  25. --max-width: 960px;
  26. --icon-size: 20px;
  27. --border-style: 1px solid #E8E8E8;
  28. --text-color: #444;
  29. font-family: 'Inter', sans-serif;
  30. color: var(--text-color);
  31. tab-size: 4;
  32. overflow: auto;
  33. max-width: 760px;
  34. margin: 0 auto;
  35. padding-top: var(--page-padding);
  36. padding-bottom: var(--page-padding);
  37. padding-right: var(--page-padding);
  38. padding-left: var(--page-padding);
  39. word-break: break-word;
  40. a {
  41. color: var(--color-blue);
  42. cursor: pointer;
  43. text-decoration: none;
  44. }
  45. h1 {
  46. font-size: 40px;
  47. line-height: 48px;
  48. font-weight: normal;
  49. margin-left: -2px;
  50. margin-top: 16px;
  51. margin-bottom: -8px;
  52. }
  53. h2 {
  54. font-size: 28px;
  55. line-height: 36px;
  56. font-weight: normal;
  57. margin-left: -1px;
  58. margin-top: 28px;
  59. margin-bottom: -8px;
  60. color: #000;
  61. }
  62. h3 {
  63. font-size: 20px;
  64. line-height: 28px;
  65. font-weight: normal;
  66. margin-top: 24px;
  67. margin-bottom: -8px;
  68. }
  69. p,
  70. div,
  71. table,
  72. ol,
  73. ul {
  74. margin-top: 16px;
  75. margin-bottom: 16px;
  76. }
  77. p {
  78. padding-right: 16px;
  79. }
  80. ul, ol {
  81. box-sizing: border-box;
  82. padding-left: 24px;
  83. }
  84. ul li,
  85. ol li {
  86. padding-left: 4px;
  87. margin-bottom: 4px;
  88. }
  89. li ul,
  90. li ol {
  91. margin-top: 4px;
  92. }
  93. table {
  94. width: calc(100% - 40px);
  95. border-collapse: collapse;
  96. margin-left: 20px;
  97. margin-right: 20px;
  98. }
  99. .desc {
  100. padding-left: 0px;
  101. }
  102. table th,
  103. table td {
  104. text-align: left;
  105. vertical-align: top;
  106. padding: 8px 6px;
  107. }
  108. table td.name,
  109. table th.name {
  110. white-space: nowrap;
  111. width: 150px;
  112. }
  113. table th {
  114. text-decoration: none;
  115. }
  116. table th:first-child,
  117. table td:first-child {
  118. padding-left: 0;
  119. }
  120. table p {
  121. margin: 0;
  122. }
  123. strong {
  124. font-weight: 600;
  125. }
  126. a.permalink {
  127. float: right;
  128. margin-left: 5px;
  129. display: none;
  130. }
  131. a.param,
  132. span.param {
  133. color: #999;
  134. }
  135. a.param:hover {
  136. color: var(--text-color);
  137. }
  138. .inheritance {
  139. color: #999;
  140. margin-bottom: 0;
  141. }
  142. .method,
  143. .member {
  144. margin-bottom: 32px;
  145. }
  146. ol.linenums {
  147. padding-left: 64px;
  148. }
  149. ol.linenums .selected {
  150. background-color: #ddd;
  151. }
  152. code {
  153. display: inline-block;
  154. vertical-align: middle;
  155. border-radius: 4px;
  156. padding: 0px 5px;
  157. background-color: #F5F5F5;
  158. }
  159. pre {
  160. overflow: auto;
  161. white-space: pre-wrap;
  162. font-size: calc(var(--font-size) - 1px);
  163. line-height: calc(var(--line-height) - 1px);
  164. position: relative;
  165. }
  166. pre code {
  167. background-color: inherit;
  168. padding: calc(var(--page-padding) - 6px) var(--page-padding);
  169. }
  170. pre.linenums code {
  171. padding: 0px 5px;
  172. }
  173. h3.name {
  174. color: #000;
  175. }
  176. h3.name a {
  177. color: var(--color-blue);
  178. text-decoration: none;
  179. }
  180. h3.name .signature {
  181. color: #000;
  182. font-weight: normal;
  183. }
  184. h3.name .type-signature {
  185. color: #999;
  186. font-weight: normal;
  187. }
  188. h3.name .type-signature a {
  189. color: #999;
  190. }
  191. h3.name .param-type {
  192. color: #999;
  193. }
  194. h3.name .param-type a {
  195. color: #999;
  196. }
  197. .search-result-item {
  198. border-bottom: var(--border-style);
  199. display: block;
  200. padding: 16px 0;
  201. }
  202. .search-result-item-description {
  203. color: var(--text-color);
  204. }
  205. h2.subsection-title + p {
  206. margin-top: 24px;
  207. }
  208. .copy-btn {
  209. cursor: pointer;
  210. position: absolute;
  211. top: 16px;
  212. right: 16px;
  213. width: 24px;
  214. height: 24px;
  215. background-color: transparent;
  216. background-image: url('/files/ic_copy_grey_24dp.svg');
  217. background-size: contain;
  218. background-position: center;
  219. background-repeat: no-repeat;
  220. opacity: 0.9;
  221. border: none;
  222. }
  223. .copy-btn:hover {
  224. opacity: 1;
  225. }
  226. .copy-btn.copied {
  227. pointer-events: none;
  228. opacity: 1;
  229. background-image: url('/files/ic_tick_green_24dp.svg');
  230. }
  231. }
  232. @media (prefers-color-scheme: dark) {
  233. #page {
  234. --text-color: #bbb;
  235. --border-style: 1px solid #444;
  236. h2 {
  237. color: var(--text-color);
  238. }
  239. h3.name {
  240. color: var(--text-color);
  241. }
  242. h3.name .signature {
  243. color: var(--text-color);
  244. }
  245. .link-anchor {
  246. color: #555;
  247. }
  248. ol.linenums .selected {
  249. background-color: #444;
  250. }
  251. code {
  252. background-color: #444;
  253. }
  254. }
  255. }
  256. @media all and ( min-width: 1700px ) {
  257. #page {
  258. --panel-width: 360px;
  259. --font-size: 18px;
  260. --line-height: 28px;
  261. --page-padding: 28px;
  262. --icon-size: 24px;
  263. max-width: 880px;
  264. h1 {
  265. font-size: 42px;
  266. line-height: 50px;
  267. }
  268. h2 {
  269. font-size: 32px;
  270. line-height: 40px;
  271. }
  272. h3 {
  273. font-size: 24px;
  274. line-height: 32px;
  275. }
  276. }
  277. }
  278. /* mobile */
  279. @media all and ( max-width: 640px ) {
  280. #page {
  281. --page-padding: 16px;
  282. --icon-size: 24px;
  283. padding: var(--page-padding);
  284. h1 {
  285. font-size: 28px;
  286. line-height: 36px;
  287. padding-right: 20px;
  288. margin-top: 0;
  289. }
  290. h2 {
  291. font-size: 24px;
  292. line-height: 32px;
  293. margin-top: 24px;
  294. }
  295. h3 {
  296. font-size: 20px;
  297. line-height: 28px;
  298. }
  299. }
  300. }
粤ICP备19079148号