page.css 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. :root {
  2. --color-blue: #049EF4;
  3. --text-color: #444;
  4. --font-size: 14px;
  5. --line-height: 24px;
  6. --font-size-sanserif: 1.128rem;
  7. --line-height-sanserif: 1.74rem;
  8. --border-style: 1px solid #E8E8E8;
  9. --header-height: 48px;
  10. --panel-width: 300px;
  11. --panel-padding: 1.143rem;
  12. --page-padding: 1.5rem;
  13. --max-width: 760px;
  14. --icon-size: 1.428rem;
  15. }
  16. @font-face {
  17. font-family: 'Roboto Mono';
  18. src: local('Roboto Mono'), local('RobotoMono-Regular'), url('../files/RobotoMono-Regular.woff2') format('woff2');
  19. font-style: normal;
  20. font-weight: 400;
  21. }
  22. @font-face {
  23. font-family: 'SF-Pro-Text';
  24. src: local('SF-Pro-Text'), url('../files/SF-Pro-Text-Regular.otf');
  25. font-weight: normal;
  26. font-style: normal;
  27. }
  28. html {
  29. font-size: var(--font-size);
  30. line-height: var(--line-height);
  31. }
  32. body {
  33. font-family: 'SF-Pro-Text', sans-serif;
  34. color: var(--text-color);
  35. tab-size: 4;
  36. overflow: auto;
  37. max-width: var(--max-width);
  38. margin: 0 auto;
  39. padding-top: var(--page-padding);
  40. padding-bottom: var(--page-padding);
  41. padding-right: var(--page-padding);
  42. padding-left: calc(var(--page-padding) + var(--panel-width));
  43. }
  44. a {
  45. color: var(--color-blue);
  46. cursor: pointer;
  47. text-decoration: none;
  48. }
  49. h1 {
  50. color: var(--color-blue);
  51. font-size: 2.8rem;
  52. line-height: 3.4rem;
  53. font-weight: normal;
  54. margin-top: 1rem;
  55. margin-bottom: -0.4rem;
  56. margin-left: -2px;
  57. }
  58. h2 {
  59. color: var(--color-blue);
  60. font-size: 2rem;
  61. line-height: 2.6rem;
  62. font-weight: normal;
  63. margin-top: 2rem;
  64. margin-bottom: -0.4rem;
  65. }
  66. h3 {
  67. color: var(--color-blue);
  68. font-size: 1.32rem;
  69. line-height: 1.48rem;
  70. font-weight: normal;
  71. margin-top: 1.8rem;
  72. margin-bottom: 1rem;
  73. }
  74. p,
  75. div,
  76. table,
  77. ol,
  78. ul {
  79. font-size: var(--font-size-sanserif);
  80. line-height: var(--line-height-sanserif);
  81. margin-top: .8rem;
  82. margin-bottom: .8rem;
  83. }
  84. p {
  85. padding-right: 1rem;
  86. }
  87. ul, ol {
  88. box-sizing: border-box;
  89. padding-left: var(--page-padding);
  90. }
  91. ul li,
  92. ol li {
  93. padding-left: 0.25rem;
  94. margin-bottom: 0.25rem;
  95. }
  96. li ul,
  97. li ol {
  98. margin-top: 0.25rem;
  99. }
  100. pre,
  101. code {
  102. margin: 1.2rem calc(-1 * var(--page-padding));
  103. }
  104. ol code,
  105. ul code {
  106. margin: 1.2rem 0;
  107. }
  108. table {
  109. width: 100%;
  110. border-collapse: collapse;
  111. }
  112. .desc {
  113. padding-left: 0px;
  114. }
  115. br {
  116. display: none;
  117. }
  118. table th,
  119. table td {
  120. text-align: left;
  121. vertical-align: top;
  122. padding: .6rem .4rem;
  123. border-bottom: var(--border-style);
  124. }
  125. table th {
  126. text-decoration: none;
  127. }
  128. table th:first-child,
  129. table td:first-child {
  130. padding-left: 0;
  131. }
  132. code {
  133. display: block;
  134. padding: 1.32rem var(--page-padding);
  135. white-space: pre-wrap;
  136. overflow: auto;
  137. box-sizing: border-box;
  138. }
  139. iframe {
  140. width: 100%;
  141. height: 420px;
  142. border:0;
  143. }
  144. table code {
  145. padding: 0px;
  146. margin: 0px;
  147. width: auto;
  148. }
  149. strong {
  150. color: #000;
  151. font-weight: normal;
  152. }
  153. /* TODO: Duplicate styles in main.css. Needed here cause button is inside the iframe */
  154. #button {
  155. position: fixed;
  156. bottom: 1rem;
  157. right: 1rem;
  158. padding: 0.5rem;
  159. border-radius: 2rem;
  160. margin-bottom: 0px;
  161. background-color: #FFF;
  162. opacity: .9;
  163. z-index: 999;
  164. box-shadow: 0 0 4px rgba(0,0,0,.15);
  165. }
  166. #button:hover {
  167. cursor: pointer;
  168. opacity: 1;
  169. }
  170. #button img {
  171. display: block;
  172. width: var(--icon-size)
  173. }
  174. a.permalink {
  175. float: right;
  176. margin-left: 5px;
  177. display: none;
  178. }
  179. a.param,
  180. span.param {
  181. color: #999;
  182. }
  183. a.param:hover {
  184. color: var(--text-color);
  185. }
  186. @media all and ( min-width: 1500px ) {
  187. :root {
  188. --panel-width: 360px;
  189. --font-size: 18px;
  190. --line-height: 30px;
  191. --header-height: 60px;
  192. --max-width: 960px;
  193. }
  194. }
  195. @media all and ( min-width: 2400px ) {
  196. :root {
  197. --panel-width: 480px;
  198. --font-size: 24px;
  199. --line-height: 38px;
  200. --header-height: 72px;
  201. --max-width: 1280px;
  202. }
  203. }
  204. /* mobile */
  205. @media all and ( max-width: 640px ) {
  206. :root {
  207. --page-padding: var(--panel-padding);
  208. }
  209. body {
  210. padding: var(--page-padding);
  211. }
  212. h1 {
  213. font-size: 2rem;
  214. line-height: 2.6rem;
  215. padding-right: 2rem;
  216. margin-top: 0;
  217. }
  218. h2 {
  219. font-size: 1.6rem;
  220. line-height: 2.2rem;
  221. margin-top: 1.6rem;
  222. }
  223. }
粤ICP备19079148号