Hackage Haddock Restyler

Switches all Haddock docs on Hackage to an updated, Retina-friendly edition of the old ocean.css for superior information density.

2021-11-13 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

  1. // ==UserScript==
  2. // @name Hackage Haddock Restyler
  3. // @description Switches all Haddock docs on Hackage to an updated, Retina-friendly edition of the old ocean.css for superior information density.
  4. // @version 1.3
  5. // @license BSD2
  6. // @grant none
  7. // @include https://hackage.haskell.org/*
  8. // @namespace https://greatest.deepsurf.us/users/833386
  9. // ==/UserScript==
  10.  
  11. [...document.head.querySelectorAll('link[rel="stylesheet"][title]:not([title="QuickJump"])')].forEach(s => {
  12. const svguri = (t) => `data:image/svg+xml;base64,${btoa(t)}`;
  13. const svg = (a, t) => svguri(`<?xml version="1.0" encoding="UTF-8"?>
  14. <svg xmlns="http://www.w3.org/2000/svg" ${a}>
  15. ${t.split("\n").map(l => ` ${l}`).join("\n")}
  16. </svg>
  17. `);
  18. const button = (extra) => svg('viewBox="0 0 9 9" width="9" height="9"',
  19. `<rect x="0" y="0" width="9" height="9" fill="#828282"/>
  20. <rect x="1" y="1" width="7" height="7" fill="#FFF"/>
  21. <rect x="2" y="4" width="5" height="1" fille="#000"/>${extra}`);
  22. const minus = button('');
  23. const plus = button(`
  24. <rect x="4" y="2" width="1" height="5" fille="#000"/>
  25. `);
  26. const hslogo = svg('width="22.65px" height="16px" viewBox="0 0 204 144"',
  27. `<g fill="#FFF">
  28. <path d="M 0 144 L 48 72 L 0 0 L 36 0 L 84 72 L 36 144"/>
  29. <path d="M 164 102 L 148 78 L 204 78 L 204 102"/>
  30. <path d="M 140 66 L 124 42 L 204 42 L 204 66"/>
  31. </g>
  32. <g fill="#CCC">
  33. <path d="M 48 144 L 96 72 L 48 0 L 84 0 L 180 144 L 144 144 L 114 99 L 84 144"/>
  34. </g>`);
  35. const synopsis = svg('xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="104" viewBox="0 0 128 104"',
  36. `<defs>
  37. <filter id="drop">
  38. <feOffset result="off" in="SourceAlpha" dx="-1.5" dy="0" />
  39. <feGaussianBlur result="blur" in="off" stdDeviation="1.5" />
  40. <feFlood flood-color="#000" flood-opacity="0.7" result="scol" />
  41. <feComposite in="scol" in2="blur" operator="in" result="shadow" />
  42. <feBlend in="SourceGraphic" in2="shadow" mode="normal" />
  43. </filter>
  44. </defs>
  45. <g transform="rotate(-90) translate(-104)">
  46. <rect id="bg" x="15.5" y="8.5" width="80" height="40" rx="5" filter="url(#drop)" fill="#faf7de" />
  47. <use xlink:href="#bg" y="64" />
  48. <path id="Synopsis" transform="translate(18 12)" fill="#4e6272"
  49. d="M 2.17,6.96
  50. C 2.17,6.96 0.03,6.96 0.03,6.96
  51. 0.02,7.59 0.13,8.13 0.37,8.59
  52. 0.60,9.05 0.92,9.43 1.31,9.73
  53. 1.71,10.03 2.17,10.25 2.69,10.40
  54. 3.21,10.54 3.75,10.61 4.30,10.61
  55. 4.98,10.61 5.59,10.53 6.11,10.37
  56. 6.63,10.21 7.06,9.98 7.41,9.70
  57. 7.76,9.41 8.03,9.07 8.21,8.67
  58. 8.39,8.27 8.47,7.85 8.47,7.38
  59. 8.47,6.82 8.35,6.35 8.12,5.99
  60. 7.88,5.63 7.59,5.34 7.27,5.12
  61. 6.94,4.90 6.61,4.75 6.28,4.65
  62. 5.94,4.55 5.68,4.48 5.50,4.44
  63. 4.87,4.28 4.36,4.15 3.97,4.05
  64. 3.58,3.94 3.28,3.84 3.06,3.73
  65. 2.84,3.63 2.69,3.52 2.62,3.39
  66. 2.54,3.27 2.50,3.11 2.50,2.91
  67. 2.50,2.70 2.55,2.52 2.64,2.38
  68. 2.74,2.24 2.86,2.12 3.00,2.02
  69. 3.15,1.93 3.31,1.86 3.49,1.82
  70. 3.66,1.79 3.84,1.77 4.02,1.77
  71. 4.29,1.77 4.54,1.79 4.77,1.84
  72. 5.00,1.89 5.21,1.97 5.38,2.08
  73. 5.56,2.20 5.70,2.35 5.81,2.55
  74. 5.92,2.75 5.98,3.00 6.00,3.31
  75. 6.00,3.31 8.14,3.31 8.14,3.31
  76. 8.14,2.72 8.03,2.22 7.81,1.80
  77. 7.59,1.38 7.29,1.04 6.92,0.77
  78. 6.54,0.50 6.11,0.30 5.63,0.18
  79. 5.15,0.06 4.64,0.00 4.12,0.00
  80. 3.67,0.00 3.22,0.06 2.77,0.18
  81. 2.32,0.31 1.92,0.49 1.56,0.75
  82. 1.21,1.00 0.92,1.32 0.70,1.70
  83. 0.48,2.08 0.37,2.53 0.37,3.05
  84. 0.37,3.51 0.45,3.90 0.63,4.23
  85. 0.80,4.55 1.03,4.82 1.31,5.04
  86. 1.59,5.26 1.91,5.43 2.26,5.57
  87. 2.62,5.71 2.98,5.82 3.36,5.92
  88. 3.72,6.02 4.08,6.11 4.44,6.20
  89. 4.80,6.28 5.12,6.38 5.40,6.50
  90. 5.68,6.61 5.91,6.75 6.08,6.92
  91. 6.25,7.09 6.34,7.31 6.34,7.58
  92. 6.34,7.84 6.27,8.05 6.14,8.21
  93. 6.01,8.38 5.85,8.51 5.65,8.60
  94. 5.45,8.69 5.24,8.76 5.02,8.79
  95. 4.79,8.82 4.58,8.84 4.38,8.84
  96. 4.09,8.84 3.81,8.81 3.54,8.73
  97. 3.27,8.66 3.03,8.55 2.83,8.41
  98. 2.63,8.26 2.47,8.07 2.35,7.83
  99. 2.23,7.59 2.17,7.30 2.17,6.96 Z
  100. M 13.16,11.33
  101. C 13.16,11.33 16.20,3.02 16.20,3.02
  102. 16.20,3.02 14.13,3.02 14.13,3.02
  103. 14.13,3.02 12.54,8.08 12.54,8.08
  104. 12.54,8.08 12.52,8.08 12.52,8.08
  105. 12.52,8.08 10.87,3.02 10.87,3.02
  106. 10.87,3.02 8.75,3.02 8.75,3.02
  107. 8.75,3.02 11.29,9.93 11.29,9.93
  108. 11.35,10.07 11.38,10.23 11.38,10.39
  109. 11.38,10.61 11.31,10.81 11.19,10.98
  110. 11.06,11.17 10.87,11.27 10.61,11.30
  111. 10.41,11.31 10.21,11.30 10.01,11.28
  112. 9.82,11.27 9.63,11.25 9.44,11.23
  113. 9.44,11.23 9.44,12.90 9.44,12.90
  114. 9.65,12.92 9.85,12.95 10.05,12.97
  115. 10.25,12.99 10.46,13.00 10.66,13.00
  116. 11.35,13.00 11.88,12.87 12.26,12.61
  117. 12.65,12.36 12.95,11.93 13.16,11.33 Z
  118. M 16.86,2.98
  119. C 16.86,2.98 16.86,10.40 16.86,10.40
  120. 16.86,10.40 18.86,10.40 18.86,10.40
  121. 18.86,10.40 18.86,6.50 18.86,6.50
  122. 18.86,5.74 18.98,5.20 19.22,4.87
  123. 19.47,4.53 19.86,4.37 20.40,4.37
  124. 20.88,4.37 21.21,4.52 21.40,4.82
  125. 21.59,5.12 21.68,5.58 21.68,6.20
  126. 21.68,6.20 21.68,10.40 21.68,10.40
  127. 21.68,10.40 23.68,10.40 23.68,10.40
  128. 23.68,10.40 23.68,5.85 23.68,5.85
  129. 23.68,5.40 23.64,4.98 23.56,4.60
  130. 23.48,4.23 23.34,3.91 23.14,3.64
  131. 22.95,3.38 22.68,3.18 22.33,3.03
  132. 21.99,2.88 21.55,2.81 21.02,2.81
  133. 20.60,2.81 20.19,2.90 19.78,3.09
  134. 19.38,3.28 19.05,3.59 18.80,4.01
  135. 18.80,4.01 18.76,4.01 18.76,4.01
  136. 18.76,4.01 18.76,2.98 18.76,2.98
  137. 18.76,2.98 16.86,2.98 16.86,2.98 Z
  138. M 26.94,6.71
  139. C 26.94,6.42 26.97,6.14 27.02,5.85
  140. 27.08,5.57 27.18,5.32 27.31,5.10
  141. 27.45,4.89 27.63,4.71 27.85,4.57
  142. 28.08,4.44 28.36,4.37 28.70,4.37
  143. 29.03,4.37 29.32,4.44 29.54,4.57
  144. 29.77,4.71 29.96,4.89 30.09,5.10
  145. 30.23,5.32 30.33,5.57 30.38,5.85
  146. 30.44,6.14 30.47,6.42 30.47,6.71
  147. 30.47,7.01 30.44,7.29 30.38,7.57
  148. 30.33,7.85 30.23,8.10 30.09,8.32
  149. 29.96,8.54 29.77,8.72 29.54,8.85
  150. 29.32,8.98 29.03,9.05 28.70,9.05
  151. 28.36,9.05 28.08,8.98 27.85,8.85
  152. 27.63,8.72 27.45,8.54 27.31,8.32
  153. 27.18,8.10 27.08,7.85 27.02,7.57
  154. 26.97,7.29 26.94,7.01 26.94,6.71 Z
  155. M 24.94,6.72
  156. C 24.94,7.32 25.03,7.85 25.21,8.33
  157. 25.39,8.81 25.64,9.21 25.97,9.55
  158. 26.30,9.89 26.69,10.15 27.15,10.34
  159. 27.61,10.52 28.12,10.61 28.70,10.61
  160. 29.27,10.61 29.78,10.52 30.25,10.34
  161. 30.71,10.15 31.11,9.89 31.44,9.55
  162. 31.76,9.21 32.02,8.81 32.19,8.33
  163. 32.37,7.85 32.46,7.32 32.46,6.72
  164. 32.46,6.13 32.37,5.59 32.19,5.11
  165. 32.02,4.63 31.76,4.22 31.44,3.88
  166. 31.11,3.54 30.71,3.27 30.25,3.09
  167. 29.78,2.90 29.27,2.81 28.70,2.81
  168. 28.12,2.81 27.61,2.90 27.15,3.09
  169. 26.69,3.27 26.30,3.54 25.97,3.88
  170. 25.64,4.22 25.39,4.63 25.21,5.11
  171. 25.03,5.59 24.94,6.13 24.94,6.72 Z
  172. M 37.45,9.05
  173. C 37.13,9.05 36.86,8.98 36.64,8.85
  174. 36.41,8.72 36.23,8.55 36.10,8.33
  175. 35.96,8.12 35.86,7.87 35.80,7.59
  176. 35.74,7.31 35.71,7.02 35.71,6.73
  177. 35.71,6.43 35.74,6.14 35.79,5.85
  178. 35.85,5.57 35.95,5.32 36.08,5.10
  179. 36.22,4.89 36.40,4.71 36.62,4.57
  180. 36.84,4.44 37.11,4.37 37.44,4.37
  181. 37.76,4.37 38.02,4.44 38.25,4.57
  182. 38.47,4.71 38.65,4.89 38.79,5.11
  183. 38.93,5.33 39.03,5.58 39.09,5.87
  184. 39.15,6.15 39.18,6.44 39.18,6.73
  185. 39.18,7.02 39.15,7.31 39.09,7.59
  186. 39.04,7.87 38.94,8.12 38.81,8.33
  187. 38.67,8.55 38.49,8.72 38.27,8.85
  188. 38.05,8.98 37.78,9.05 37.45,9.05 Z
  189. M 33.78,3.03
  190. C 33.78,3.03 33.78,13.00 33.78,13.00
  191. 33.78,13.00 35.78,13.00 35.78,13.00
  192. 35.78,13.00 35.78,9.48 35.78,9.48
  193. 35.78,9.48 35.81,9.48 35.81,9.48
  194. 36.05,9.85 36.36,10.13 36.74,10.32
  195. 37.12,10.51 37.54,10.61 37.99,10.61
  196. 38.52,10.61 38.99,10.50 39.38,10.29
  197. 39.78,10.08 40.11,9.80 40.38,9.45
  198. 40.65,9.09 40.85,8.69 40.98,8.23
  199. 41.11,7.77 41.17,7.29 41.17,6.79
  200. 41.17,6.27 41.11,5.76 40.98,5.28
  201. 40.85,4.80 40.65,4.38 40.37,4.01
  202. 40.10,3.65 39.76,3.36 39.35,3.14
  203. 38.94,2.92 38.44,2.81 37.87,2.81
  204. 37.42,2.81 37.01,2.90 36.64,3.09
  205. 36.26,3.27 35.95,3.57 35.71,3.97
  206. 35.71,3.97 35.68,3.97 35.68,3.97
  207. 35.68,3.97 35.68,3.03 35.68,3.03
  208. 35.68,3.03 33.78,3.03 33.78,3.03 Z
  209. M 43.95,8.01
  210. C 43.95,8.01 42.05,8.01 42.05,8.01
  211. 42.07,8.51 42.18,8.92 42.38,9.25
  212. 42.58,9.58 42.84,9.85 43.15,10.05
  213. 43.46,10.25 43.82,10.39 44.23,10.48
  214. 44.63,10.56 45.04,10.61 45.46,10.61
  215. 45.87,10.61 46.28,10.57 46.68,10.49
  216. 47.08,10.40 47.43,10.26 47.74,10.06
  217. 48.05,9.86 48.30,9.60 48.49,9.27
  218. 48.68,8.94 48.78,8.53 48.78,8.04
  219. 48.78,7.69 48.71,7.40 48.58,7.17
  220. 48.45,6.93 48.28,6.74 48.06,6.58
  221. 47.85,6.42 47.60,6.29 47.32,6.20
  222. 47.05,6.10 46.76,6.02 46.47,5.96
  223. 46.19,5.89 45.92,5.83 45.65,5.77
  224. 45.37,5.71 45.13,5.65 44.92,5.58
  225. 44.71,5.50 44.54,5.41 44.41,5.29
  226. 44.28,5.18 44.21,5.03 44.21,4.85
  227. 44.21,4.70 44.25,4.57 44.33,4.48
  228. 44.40,4.39 44.49,4.32 44.60,4.28
  229. 44.71,4.23 44.83,4.20 44.96,4.18
  230. 45.09,4.17 45.21,4.16 45.32,4.16
  231. 45.68,4.16 45.99,4.23 46.25,4.38
  232. 46.51,4.52 46.66,4.79 46.69,5.20
  233. 46.69,5.20 48.58,5.20 48.58,5.20
  234. 48.54,4.74 48.43,4.35 48.24,4.05
  235. 48.04,3.74 47.80,3.50 47.51,3.32
  236. 47.22,3.13 46.89,3.00 46.52,2.93
  237. 46.15,2.85 45.77,2.81 45.38,2.81
  238. 44.98,2.81 44.60,2.84 44.23,2.92
  239. 43.85,2.99 43.51,3.11 43.21,3.29
  240. 42.91,3.47 42.67,3.71 42.49,4.01
  241. 42.31,4.32 42.22,4.71 42.22,5.19
  242. 42.22,5.51 42.28,5.79 42.41,6.01
  243. 42.54,6.24 42.72,6.42 42.93,6.57
  244. 43.15,6.72 43.39,6.84 43.67,6.93
  245. 43.95,7.02 44.23,7.10 44.52,7.16
  246. 45.23,7.32 45.79,7.47 46.19,7.62
  247. 46.58,7.78 46.78,8.00 46.78,8.31
  248. 46.78,8.49 46.74,8.64 46.66,8.76
  249. 46.57,8.88 46.47,8.98 46.34,9.05
  250. 46.21,9.12 46.07,9.17 45.92,9.21
  251. 45.76,9.24 45.62,9.26 45.48,9.26
  252. 45.28,9.26 45.09,9.23 44.91,9.18
  253. 44.73,9.14 44.56,9.06 44.42,8.96
  254. 44.28,8.86 44.17,8.73 44.08,8.58
  255. 43.99,8.42 43.95,8.23 43.95,8.01 Z
  256. M 52.04,1.87
  257. C 52.04,1.87 52.04,0.21 52.04,0.21
  258. 52.04,0.21 50.05,0.21 50.05,0.21
  259. 50.05,0.21 50.05,1.87 50.05,1.87
  260. 50.05,1.87 52.04,1.87 52.04,1.87 Z
  261. M 50.05,3.03
  262. C 50.05,3.03 50.05,10.40 50.05,10.40
  263. 50.05,10.40 52.04,10.40 52.04,10.40
  264. 52.04,10.40 52.04,3.03 52.04,3.03
  265. 52.04,3.03 50.05,3.03 50.05,3.03 Z
  266. M 55.12,8.01
  267. C 55.12,8.01 53.23,8.01 53.23,8.01
  268. 53.25,8.51 53.36,8.92 53.56,9.25
  269. 53.76,9.58 54.02,9.85 54.33,10.05
  270. 54.64,10.25 55.00,10.39 55.41,10.48
  271. 55.81,10.56 56.22,10.61 56.64,10.61
  272. 57.05,10.61 57.46,10.57 57.86,10.49
  273. 58.26,10.40 58.61,10.26 58.92,10.06
  274. 59.23,9.86 59.48,9.60 59.67,9.27
  275. 59.86,8.94 59.96,8.53 59.96,8.04
  276. 59.96,7.69 59.89,7.40 59.76,7.17
  277. 59.63,6.93 59.46,6.74 59.24,6.58
  278. 59.03,6.42 58.78,6.29 58.50,6.20
  279. 58.23,6.10 57.94,6.02 57.65,5.96
  280. 57.37,5.89 57.10,5.83 56.83,5.77
  281. 56.55,5.71 56.31,5.65 56.10,5.58
  282. 55.89,5.50 55.72,5.41 55.59,5.29
  283. 55.46,5.18 55.39,5.03 55.39,4.85
  284. 55.39,4.70 55.43,4.57 55.50,4.48
  285. 55.58,4.39 55.67,4.32 55.78,4.28
  286. 55.89,4.23 56.01,4.20 56.14,4.18
  287. 56.27,4.17 56.39,4.16 56.50,4.16
  288. 56.86,4.16 57.17,4.23 57.43,4.38
  289. 57.69,4.52 57.84,4.79 57.87,5.20
  290. 57.87,5.20 59.76,5.20 59.76,5.20
  291. 59.72,4.74 59.61,4.35 59.42,4.05
  292. 59.22,3.74 58.98,3.50 58.69,3.32
  293. 58.40,3.13 58.07,3.00 57.70,2.93
  294. 57.33,2.85 56.95,2.81 56.56,2.81
  295. 56.16,2.81 55.78,2.84 55.41,2.92
  296. 55.03,2.99 54.69,3.11 54.39,3.29
  297. 54.09,3.47 53.85,3.71 53.67,4.01
  298. 53.49,4.32 53.40,4.71 53.40,5.19
  299. 53.40,5.51 53.46,5.79 53.59,6.01
  300. 53.72,6.24 53.90,6.42 54.11,6.57
  301. 54.33,6.72 54.57,6.84 54.85,6.93
  302. 55.13,7.02 55.41,7.10 55.70,7.16
  303. 56.41,7.32 56.97,7.47 57.37,7.62
  304. 57.76,7.78 57.96,8.00 57.96,8.31
  305. 57.96,8.49 57.92,8.64 57.84,8.76
  306. 57.75,8.88 57.65,8.98 57.52,9.05
  307. 57.39,9.12 57.25,9.17 57.10,9.21
  308. 56.94,9.24 56.80,9.26 56.66,9.26
  309. 56.46,9.26 56.27,9.23 56.09,9.18
  310. 55.91,9.14 55.74,9.06 55.60,8.96
  311. 55.46,8.86 55.35,8.73 55.26,8.58
  312. 55.17,8.42 55.12,8.23 55.12,8.01 Z" />
  313. <path id="arrowout" fill="#b0b0b0" d="M 0 0 H 9 V 9 H 6 V 3 H 0 Z" transform="translate(81.5 16.5) rotate(-45) "/>
  314. <path id="arrowin" fill="#b0b0b0" d="M 9 9 H 0 V 0 H 3 V 6 H 9 Z" transform="translate(81.5 77.5) rotate(-45) "/>
  315. <use xlink:href="#Synopsis" y="64" />
  316. <use xlink:href="#arrowout" y="7" />
  317. <use xlink:href="#arrowin" y="7"/>
  318. </g>`);
  319. // ocean.css comes from the Hackage package <https://github.com/haskell/hackage>, which is under a BSD 2-clause license and (c) Simon Marlow & contributors.
  320. s.href = 'data:text/css;charset=UTF-8,'
  321. + encodeURIComponent(`:root {
  322. --img-plus: url('${plus}');
  323. --img-minus: url('${minus}');
  324. --img-hslogo: url('${hslogo}');
  325. --img-synopsis: url('${synopsis}');
  326. }
  327.  
  328. /* @group Fundamentals */
  329.  
  330. * { margin: 0; padding: 0 }
  331.  
  332. /* Is this portable? */
  333. html {
  334. background-color: white;
  335. width: 100%;
  336. height: 100%;
  337. }
  338.  
  339. body {
  340. background: white;
  341. color: black;
  342. text-align: left;
  343. min-height: 100%;
  344. position: relative;
  345. }
  346.  
  347. p {
  348. margin: 0.8em 0;
  349. }
  350.  
  351. ul, ol {
  352. margin: 0.8em 0 0.8em 2em;
  353. }
  354.  
  355. dl {
  356. margin: 0.8em 0;
  357. }
  358.  
  359. dt {
  360. font-weight: bold;
  361. }
  362. dd {
  363. margin-left: 2em;
  364. }
  365.  
  366. a { text-decoration: none; }
  367. a[href]:link { color: rgb(196,69,29); }
  368. a[href]:visited { color: rgb(171,105,84); }
  369. a[href]:hover { text-decoration:underline; }
  370.  
  371. a[href].def:link, a[href].def:visited { color: black; }
  372. a[href].def:hover { color: rgb(78, 98, 114); }
  373.  
  374. /* @end */
  375.  
  376. /* @group Show and hide with JS */
  377.  
  378. body.js-enabled .hide-when-js-enabled {
  379. display: none;
  380. }
  381.  
  382. /* @end */
  383.  
  384. /* @group Fonts & Sizes */
  385.  
  386. /* Basic technique & IE workarounds from YUI 3
  387. For reasons, see:
  388. http://yui.yahooapis.com/3.1.1/build/cssfonts/fonts.css
  389. */
  390.  
  391. body {
  392. font:13px/1.4 sans-serif;
  393. *font-size:small; /* for IE */
  394. *font:x-small; /* for IE in quirks mode */
  395. }
  396.  
  397. h1 { font-size: 146.5%; /* 19pt */ }
  398. h2 { font-size: 131%; /* 17pt */ }
  399. h3 { font-size: 116%; /* 15pt */ }
  400. h4 { font-size: 100%; /* 13pt */ }
  401. h5 { font-size: 100%; /* 13pt */ }
  402.  
  403. select, input, button, textarea {
  404. font:99% sans-serif;
  405. }
  406.  
  407. table {
  408. font-size:inherit;
  409. font:100%;
  410. }
  411.  
  412. pre, code, kbd, samp, tt, .src {
  413. font-family:monospace;
  414. *font-size:108%;
  415. line-height: 124%;
  416. }
  417.  
  418. .links, .link {
  419. font-size: 85%; /* 11pt */
  420. }
  421.  
  422. #module-header .caption {
  423. font-size: 182%; /* 24pt */
  424. }
  425.  
  426. #module-header .caption sup {
  427. font-size: 70%;
  428. font-weight: normal;
  429. }
  430.  
  431. .info {
  432. font-size: 85%; /* 11pt */
  433. }
  434.  
  435. #table-of-contents, #synopsis {
  436. /* font-size: 85%; /* 11pt */
  437. }
  438.  
  439.  
  440. /* @end */
  441.  
  442. /* @group Common */
  443.  
  444. .caption, h1, h2, h3, h4, h5, h6, summary {
  445. font-weight: bold;
  446. color: rgb(78,98,114);
  447. margin: 0.8em 0 0.4em;
  448. }
  449.  
  450. * + h1, * + h2, * + h3, * + h4, * + h5, * + h6 {
  451. margin-top: 2em;
  452. }
  453.  
  454. h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 {
  455. margin-top: inherit;
  456. }
  457.  
  458. ul.links {
  459. list-style: none;
  460. text-align: left;
  461. float: right;
  462. display: inline-table;
  463. margin: 0 0 0 1em;
  464. }
  465.  
  466. ul.links li {
  467. display: inline;
  468. border-left: 1px solid #d5d5d5;
  469. white-space: nowrap;
  470. padding: 0;
  471. }
  472.  
  473. ul.links li a {
  474. padding: 0.2em 0.5em;
  475. }
  476.  
  477. .hide { display: none; }
  478. .show { display: inherit; }
  479. .clear { clear: both; }
  480.  
  481. .collapser {
  482. background-image: var(--img-minus);
  483. background-repeat: no-repeat;
  484. }
  485. .expander {
  486. background-image: var(--img-plus);
  487. background-repeat: no-repeat;
  488. }
  489. .collapser, .expander {
  490. padding-left: 14px;
  491. margin-left: -14px;
  492. cursor: pointer;
  493. }
  494. p.caption.collapser,
  495. p.caption.expander {
  496. background-position: 0 0.4em;
  497. }
  498.  
  499. .instance.collapser, .instance.expander {
  500. margin-left: 0px;
  501. background-position: left center;
  502. min-width: 9px;
  503. min-height: 9px;
  504. }
  505.  
  506. summary {
  507. cursor: pointer;
  508. outline: none;
  509. list-style-image: var(--img-plus);
  510. list-style-position: outside;
  511. }
  512.  
  513. details[open] > summary {
  514. list-style-image: var(--img-minus);
  515. }
  516.  
  517. pre {
  518. padding: 0.25em;
  519. margin: 0.8em 0;
  520. background: rgb(229,237,244);
  521. overflow: auto;
  522. border-bottom: 0.25em solid white;
  523. /* white border adds some space below the box to compensate
  524. for visual extra space that paragraphs have between baseline
  525. and the bounding box */
  526. }
  527.  
  528. .src {
  529. background: #f0f0f0;
  530. padding: 0.2em 0.5em;
  531. }
  532.  
  533. .keyword { font-weight: normal; }
  534. .def { font-weight: bold; }
  535.  
  536. @media print {
  537. #footer { display: none; }
  538. }
  539.  
  540. /* @end */
  541.  
  542. /* @group Page Structure */
  543.  
  544. #content {
  545. margin: 0 auto;
  546. padding: 0 2em 6em;
  547. }
  548.  
  549. #package-header {
  550. background: rgb(41,56,69);
  551. border-top: 5px solid rgb(78,98,114);
  552. color: #ddd;
  553. padding: 0.2em;
  554. position: relative;
  555. text-align: left;
  556. }
  557.  
  558. #package-header .caption {
  559. background: var(--img-hslogo) no-repeat 0em;
  560. color: white;
  561. margin: 0 2em;
  562. font-weight: normal;
  563. font-style: normal;
  564. padding-left: 2em;
  565. }
  566.  
  567. #package-header a:link, #package-header a:visited { color: white; }
  568. #package-header a:hover { background: rgb(78,98,114); }
  569.  
  570. #module-header .caption {
  571. color: rgb(78,98,114);
  572. font-weight: bold;
  573. border-bottom: 1px solid #ddd;
  574. }
  575.  
  576. table.info {
  577. float: right;
  578. padding: 0.5em 1em;
  579. border: 1px solid #ddd;
  580. color: rgb(78,98,114);
  581. background-color: #fff;
  582. max-width: 40%;
  583. border-spacing: 0;
  584. position: relative;
  585. top: -0.5em;
  586. margin: 0 0 0 2em;
  587. }
  588.  
  589. .info th {
  590. padding: 0 1em 0 0;
  591. }
  592.  
  593. div#style-menu-holder {
  594. position: relative;
  595. z-index: 2;
  596. display: inline;
  597. }
  598.  
  599. #style-menu {
  600. position: absolute;
  601. z-index: 1;
  602. overflow: visible;
  603. background: #374c5e;
  604. margin: 0;
  605. text-align: center;
  606. right: 0;
  607. padding: 0;
  608. top: 1.25em;
  609. }
  610.  
  611. #style-menu li {
  612. display: list-item;
  613. border-style: none;
  614. margin: 0;
  615. padding: 0;
  616. color: #000;
  617. list-style-type: none;
  618. }
  619.  
  620. #style-menu li + li {
  621. border-top: 1px solid #919191;
  622. }
  623.  
  624. #style-menu a {
  625. width: 6em;
  626. padding: 3px;
  627. display: block;
  628. }
  629.  
  630. #footer {
  631. background: #ddd;
  632. border-top: 1px solid #aaa;
  633. padding: 0.5em 0;
  634. color: #666;
  635. text-align: center;
  636. position: absolute;
  637. bottom: 0;
  638. width: 100%;
  639. height: 3em;
  640. }
  641.  
  642. /* @end */
  643.  
  644. /* @group Front Matter */
  645.  
  646. #table-of-contents {
  647. float: right;
  648. clear: right;
  649. background: #faf9dc;
  650. border: 1px solid #d8d7ad;
  651. padding: 0.5em 1em;
  652. max-width: 20em;
  653. margin: 0.5em 0 1em 1em;
  654. }
  655.  
  656. #table-of-contents .caption {
  657. text-align: center;
  658. margin: 0;
  659. }
  660.  
  661. #table-of-contents ul {
  662. list-style: none;
  663. margin: 0;
  664. }
  665.  
  666. #table-of-contents ul ul {
  667. margin-left: 2em;
  668. }
  669.  
  670. #description .caption {
  671. display: none;
  672. }
  673.  
  674. #synopsis {
  675. display: block;
  676. position: fixed;
  677. right: 0;
  678. height: 80%;
  679. top: 10%;
  680. padding: 0;
  681. max-width: 75%;
  682. /* Ensure that synopsis covers everything (including MathJAX markup) */
  683. z-index: 1;
  684. }
  685.  
  686. #synopsis summary {
  687. display: block;
  688. float: left;
  689. width: 29px;
  690. color: rgba(255,255,255,0);
  691. height: 110px;
  692. margin: 0;
  693. font-size: 1px;
  694. padding: 0;
  695. background: var(--img-synopsis) no-repeat 0px -8px;
  696. }
  697.  
  698. #synopsis details[open] > summary {
  699. background: var(--img-synopsis) no-repeat -64px -8px;
  700. }
  701.  
  702. #synopsis ul {
  703. height: 100%;
  704. overflow: auto;
  705. padding: 0.5em;
  706. margin: 0;
  707. }
  708.  
  709. #synopsis ul ul {
  710. overflow: hidden;
  711. }
  712.  
  713. #synopsis ul,
  714. #synopsis ul li.src {
  715. background-color: #faf9dc;
  716. white-space: nowrap;
  717. list-style: none;
  718. margin-left: 0;
  719. }
  720.  
  721. /* @end */
  722.  
  723. /* @group Main Content */
  724.  
  725. #interface div.top { margin: 2em 0; }
  726. #interface h1 + div.top,
  727. #interface h2 + div.top,
  728. #interface h3 + div.top,
  729. #interface h4 + div.top,
  730. #interface h5 + div.top {
  731. margin-top: 1em;
  732. }
  733. #interface .src .selflink,
  734. #interface .src .link {
  735. float: right;
  736. color: #919191;
  737. background: #f0f0f0;
  738. padding: 0 0.5em 0.2em;
  739. margin: 0 -0.5em 0 0;
  740. -moz-user-select: none;
  741. }
  742. #interface .src .selflink {
  743. border-left: 1px solid #919191;
  744. margin: 0 -0.5em 0 0.5em;
  745. }
  746.  
  747. #interface span.fixity {
  748. color: #919191;
  749. border-left: 1px solid #919191;
  750. padding: 0.2em 0.5em 0.2em 0.5em;
  751. margin: 0 -1em 0 1em;
  752. }
  753.  
  754. #interface span.rightedge {
  755. border-left: 1px solid #919191;
  756. padding: 0.2em 0 0.2em 0;
  757. margin: 0 0 0 1em;
  758. }
  759.  
  760. #interface table { border-spacing: 2px; }
  761. #interface td {
  762. vertical-align: top;
  763. padding-left: 0.5em;
  764. }
  765.  
  766. #interface td.doc p {
  767. margin: 0;
  768. }
  769. #interface td.doc p + p {
  770. margin-top: 0.8em;
  771. }
  772.  
  773. .doc table {
  774. border-collapse: collapse;
  775. border-spacing: 0px;
  776. }
  777.  
  778. .doc th,
  779. .doc td {
  780. padding: 5px;
  781. border: 1px solid #ddd;
  782. }
  783.  
  784. .doc th {
  785. background-color: #f0f0f0;
  786. }
  787.  
  788. .clearfix:after {
  789. clear: both;
  790. content: " ";
  791. display: block;
  792. height: 0;
  793. visibility: hidden;
  794. }
  795.  
  796. .subs.fields ul {
  797. list-style: none;
  798. display: table;
  799. margin: 0;
  800. }
  801.  
  802. .subs.fields ul li {
  803. display: table-row;
  804. }
  805.  
  806. .subs ul li dfn {
  807. display: table-cell;
  808. font-style: normal;
  809. font-weight: bold;
  810. margin: 1px 0;
  811. white-space: nowrap;
  812. }
  813.  
  814. .subs ul li > .doc {
  815. display: table-cell;
  816. padding-left: 0.5em;
  817. margin-bottom: 0.5em;
  818. }
  819.  
  820. .subs ul li > .doc p {
  821. margin: 0;
  822. }
  823.  
  824. /* Render short-style data instances */
  825. .inst ul {
  826. height: 100%;
  827. padding: 0.5em;
  828. margin: 0;
  829. }
  830.  
  831. .inst, .inst li {
  832. list-style: none;
  833. margin-left: 1em;
  834. }
  835.  
  836. /* Workaround for bug in Firefox (issue #384) */
  837. .inst-left {
  838. float: left;
  839. }
  840.  
  841. .top p.src {
  842. border-top: 1px solid #ccc;
  843. }
  844.  
  845. .subs, .doc {
  846. /* use this selector for one level of indent */
  847. padding-left: 2em;
  848. }
  849.  
  850. .warning {
  851. color: red;
  852. }
  853.  
  854. .arguments {
  855. margin-top: -0.4em;
  856. }
  857. .arguments .caption {
  858. display: none;
  859. }
  860.  
  861. .fields { padding-left: 1em; }
  862.  
  863. .fields .caption { display: none; }
  864.  
  865. .fields p { margin: 0 0; }
  866.  
  867. /* this seems bulky to me
  868. .methods, .constructors {
  869. background: #f8f8f8;
  870. border: 1px solid #eee;
  871. }
  872. */
  873.  
  874. /* @end */
  875.  
  876. /* @group Auxillary Pages */
  877.  
  878.  
  879. .extension-list {
  880. list-style-type: none;
  881. margin-left: 0;
  882. }
  883.  
  884. #mini {
  885. margin: 0 auto;
  886. padding: 0 1em 1em;
  887. }
  888.  
  889. #mini > * {
  890. font-size: 93%; /* 12pt */
  891. }
  892.  
  893. #mini #module-list .caption,
  894. #mini #module-header .caption {
  895. font-size: 125%; /* 15pt */
  896. }
  897.  
  898. #mini #interface h1,
  899. #mini #interface h2,
  900. #mini #interface h3,
  901. #mini #interface h4 {
  902. font-size: 109%; /* 13pt */
  903. margin: 1em 0 0;
  904. }
  905.  
  906. #mini #interface .top,
  907. #mini #interface .src {
  908. margin: 0;
  909. }
  910.  
  911. #mini #module-list ul {
  912. list-style: none;
  913. margin: 0;
  914. }
  915.  
  916. #alphabet ul {
  917. list-style: none;
  918. padding: 0;
  919. margin: 0.5em 0 0;
  920. text-align: center;
  921. }
  922.  
  923. #alphabet li {
  924. display: inline;
  925. margin: 0 0.25em;
  926. }
  927.  
  928. #alphabet a {
  929. font-weight: bold;
  930. }
  931.  
  932. #index .caption,
  933. #module-list .caption { font-size: 131%; /* 17pt */ }
  934.  
  935. #index table {
  936. margin-left: 2em;
  937. }
  938.  
  939. #index .src {
  940. font-weight: bold;
  941. }
  942. #index .alt {
  943. font-size: 77%; /* 10pt */
  944. font-style: italic;
  945. padding-left: 2em;
  946. }
  947.  
  948. #index td + td {
  949. padding-left: 1em;
  950. }
  951.  
  952. #module-list ul {
  953. list-style: none;
  954. margin: 0 0 0 2em;
  955. }
  956.  
  957. #module-list li {
  958. clear: right;
  959. }
  960.  
  961. #module-list span.collapser,
  962. #module-list span.expander {
  963. background-position: 0 0.3em;
  964. }
  965.  
  966. #module-list .package {
  967. float: right;
  968. }
  969.  
  970. :target {
  971. background-color: #ffff00;
  972. }
  973.  
  974. /* @end */
  975. `);
  976. });