1
0

page.css 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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 {
  135. position: relative;
  136. }
  137. code.inline {
  138. display: inline-block;
  139. vertical-align: middle;
  140. border-radius: 4px;
  141. padding: 0px 5px;
  142. background: #F5F5F5;
  143. margin: 0;
  144. }
  145. .copy-btn {
  146. cursor: pointer;
  147. position: absolute;
  148. top: 16px;
  149. right: 16px;
  150. width: 24px;
  151. height: 24px;
  152. background-color: transparent;
  153. background-image: url('../files/ic_copy_grey_24dp.svg');
  154. background-size: contain;
  155. background-position: center;
  156. background-repeat: no-repeat;
  157. opacity: 0.9;
  158. border: none;
  159. }
  160. .copy-btn:hover {
  161. opacity: 1;
  162. }
  163. .copy-btn.copied {
  164. pointer-events: none;
  165. opacity: 1;
  166. background-image: url('../files/ic_tick_green_24dp.svg');
  167. }
  168. table {
  169. width: 100%;
  170. border-collapse: collapse;
  171. }
  172. .desc {
  173. padding-left: 0px;
  174. }
  175. table th,
  176. table td {
  177. text-align: left;
  178. vertical-align: top;
  179. padding: 8px 6px;
  180. border-bottom: var(--border-style);
  181. }
  182. table th {
  183. text-decoration: none;
  184. }
  185. table th:first-child,
  186. table td:first-child {
  187. padding-left: 0;
  188. }
  189. code:not(.inline) {
  190. display: block;
  191. padding: calc(var(--page-padding) - 6px) var(--page-padding);
  192. white-space: pre-wrap;
  193. overflow: auto;
  194. box-sizing: border-box;
  195. }
  196. iframe {
  197. width: 100%;
  198. height: 420px;
  199. border:0;
  200. }
  201. table code {
  202. padding: 0px;
  203. margin: 0px;
  204. width: auto;
  205. }
  206. strong {
  207. font-weight: 600;
  208. }
  209. /* TODO: Duplicate styles in main.css. Needed here cause button is inside the iframe */
  210. #button {
  211. position: fixed;
  212. bottom: 16px;
  213. right: 16px;
  214. padding: 12px;
  215. border-radius: 50%;
  216. margin-bottom: 0px;
  217. background-color: #FFF;
  218. opacity: .9;
  219. z-index: 999;
  220. box-shadow: 0 0 4px rgba(0,0,0,.15);
  221. }
  222. #button:hover {
  223. cursor: pointer;
  224. opacity: 1;
  225. }
  226. #button img {
  227. display: block;
  228. width: var(--icon-size);
  229. }
  230. a.permalink {
  231. float: right;
  232. margin-left: 5px;
  233. display: none;
  234. }
  235. a.param,
  236. span.param {
  237. color: #999;
  238. }
  239. a.param:hover {
  240. color: var(--text-color);
  241. }
  242. @media all and ( min-width: 1700px ) {
  243. :root {
  244. --panel-width: 360px;
  245. --font-size: 18px;
  246. --line-height: 28px;
  247. --max-width: 880px;
  248. --page-padding: 28px;
  249. --icon-size: 24px;
  250. }
  251. h1 {
  252. font-size: 42px;
  253. line-height: 50px;
  254. }
  255. h2 {
  256. font-size: 32px;
  257. line-height: 40px;
  258. }
  259. h3 {
  260. font-size: 24px;
  261. line-height: 32px;
  262. }
  263. }
  264. /* mobile */
  265. @media all and ( max-width: 640px ) {
  266. :root {
  267. --page-padding: 16px;
  268. --icon-size: 24px;
  269. }
  270. body {
  271. padding: var(--page-padding);
  272. }
  273. h1 {
  274. font-size: 28px;
  275. line-height: 36px;
  276. padding-right: 20px;
  277. margin-top: 0;
  278. }
  279. h2 {
  280. font-size: 24px;
  281. line-height: 32px;
  282. margin-top: 24px;
  283. }
  284. h3 {
  285. font-size: 20px;
  286. line-height: 28px;
  287. }
  288. .copy-btn {
  289. top: 12px;
  290. right: 8px;
  291. width: 20px;
  292. height: 20px;
  293. }
  294. }
粤ICP备19079148号