page.css 4.4 KB

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