prism.css 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. /* PrismJS 1.21.0
  2. https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+typescript&plugins=line-highlight+line-numbers+show-language+highlight-keywords+toolbar */
  3. /**
  4. * okaidia theme for JavaScript, CSS and HTML
  5. * Loosely based on Monokai textmate theme by http://www.monokai.nl/
  6. * @author ocodia
  7. */
  8. code[class*="language-"],
  9. pre[class*="language-"] {
  10. color: #f8f8f2 !important;
  11. background: none;
  12. text-shadow: 0 1px rgba(0, 0, 0, 0.3);
  13. font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  14. font-size: 1em;
  15. text-align: left;
  16. white-space: pre;
  17. word-spacing: normal;
  18. word-break: normal;
  19. word-wrap: normal;
  20. line-height: 1.5;
  21. -moz-tab-size: 4;
  22. -o-tab-size: 4;
  23. tab-size: 4;
  24. -webkit-hyphens: none;
  25. -moz-hyphens: none;
  26. -ms-hyphens: none;
  27. hyphens: none;
  28. }
  29. /* Code blocks */
  30. pre[class*="language-"] {
  31. padding: 1em;
  32. margin: .5em 0;
  33. overflow: auto;
  34. border-radius: 0.3em;
  35. }
  36. :not(pre) > code[class*="language-"],
  37. pre[class*="language-"] {
  38. background: #272822;
  39. }
  40. /* Inline code */
  41. :not(pre) > code[class*="language-"] {
  42. padding: .1em;
  43. border-radius: .3em;
  44. white-space: normal;
  45. }
  46. .token.comment,
  47. .token.prolog,
  48. .token.doctype,
  49. .token.cdata {
  50. color: #8292a2 !important;;
  51. }
  52. .token.punctuation {
  53. color: #f8f8f2 !important;;
  54. }
  55. .token.namespace {
  56. opacity: .7;
  57. }
  58. .token.property,
  59. .token.tag,
  60. .token.constant,
  61. .token.symbol,
  62. .token.deleted {
  63. color: #f92672 !important;;
  64. }
  65. .token.boolean,
  66. .token.number {
  67. color: #ae81ff !important;;
  68. }
  69. .token.selector,
  70. .token.attr-name,
  71. .token.string,
  72. .token.char,
  73. .token.builtin,
  74. .token.inserted {
  75. color: #a6e22e !important;;
  76. }
  77. .token.operator,
  78. .token.entity,
  79. .token.url,
  80. .language-css .token.string,
  81. .style .token.string,
  82. .token.variable {
  83. color: #f8f8f2 !important;;
  84. }
  85. .token.atrule,
  86. .token.attr-value,
  87. .token.function,
  88. .token.class-name {
  89. color: #e6db74 !important;;
  90. }
  91. .token.keyword {
  92. color: #66d9ef !important;;
  93. }
  94. .token.regex,
  95. .token.important {
  96. color: #fd971f !important;;
  97. }
  98. .token.important,
  99. .token.bold {
  100. font-weight: bold;
  101. }
  102. .token.italic {
  103. font-style: italic;
  104. }
  105. .token.entity {
  106. cursor: help;
  107. }
  108. pre[data-line] {
  109. position: relative;
  110. padding: 1em 0 1em 3em;
  111. }
  112. .line-highlight {
  113. position: absolute;
  114. left: 0;
  115. right: 0;
  116. /*padding: inherit 0;*/
  117. margin-top: 1em; /* Same as .prism’s padding-top */
  118. background: hsla(24, 20%, 50%,.08);
  119. background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0));
  120. pointer-events: none;
  121. line-height: inherit;
  122. white-space: pre;
  123. }
  124. .line-highlight:before,
  125. .line-highlight[data-end]:after {
  126. content: attr(data-start);
  127. position: absolute;
  128. top: .4em;
  129. left: .6em;
  130. min-width: 1em;
  131. padding: 0 .5em;
  132. background-color: hsla(24, 20%, 50%,.4);
  133. color: hsl(24, 20%, 95%) !important;;
  134. font: bold 65%/1.5 sans-serif;
  135. text-align: center;
  136. vertical-align: .3em;
  137. border-radius: 999px;
  138. text-shadow: none;
  139. box-shadow: 0 1px white;
  140. }
  141. .line-highlight[data-end]:after {
  142. content: attr(data-end);
  143. top: auto;
  144. bottom: .4em;
  145. }
  146. .line-numbers .line-highlight:before,
  147. .line-numbers .line-highlight:after {
  148. content: none;
  149. }
  150. pre[id].linkable-line-numbers span.line-numbers-rows {
  151. pointer-events: all;
  152. }
  153. pre[id].linkable-line-numbers span.line-numbers-rows > span:before {
  154. cursor: pointer;
  155. }
  156. pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before {
  157. background-color: rgba(128, 128, 128, .2) !important;;
  158. }
  159. pre[class*="language-"].line-numbers {
  160. position: relative;
  161. padding-left: 3.8em !important;
  162. counter-reset: linenumber;
  163. }
  164. pre[class*="language-"].line-numbers > code {
  165. position: relative;
  166. white-space: inherit;
  167. }
  168. .line-numbers .line-numbers-rows {
  169. position: absolute;
  170. pointer-events: none;
  171. top: 0;
  172. font-size: 100%;
  173. left: -3.8em;
  174. width: 3em; /* works for line-numbers below 1000 lines */
  175. letter-spacing: -1px;
  176. border-right: 1px solid #999;
  177. -webkit-user-select: none;
  178. -moz-user-select: none;
  179. -ms-user-select: none;
  180. user-select: none;
  181. }
  182. .line-numbers-rows > span {
  183. display: block;
  184. counter-increment: linenumber;
  185. }
  186. .line-numbers-rows > span:before {
  187. content: counter(linenumber);
  188. color: #999 !important;;
  189. display: block;
  190. padding-right: 0.8em;
  191. text-align: right;
  192. }
  193. div.code-toolbar {
  194. position: relative;
  195. }
  196. div.code-toolbar > .toolbar {
  197. position: absolute;
  198. top: .3em;
  199. right: .2em;
  200. transition: opacity 0.3s ease-in-out;
  201. opacity: 0;
  202. }
  203. div.code-toolbar:hover > .toolbar {
  204. opacity: 1;
  205. }
  206. /* Separate line b/c rules are thrown out if selector is invalid.
  207. IE11 and old Edge versions don't support :focus-within. */
  208. div.code-toolbar:focus-within > .toolbar {
  209. opacity: 1;
  210. }
  211. div.code-toolbar > .toolbar .toolbar-item {
  212. display: inline-block;
  213. }
  214. div.code-toolbar > .toolbar a {
  215. cursor: pointer;
  216. }
  217. div.code-toolbar > .toolbar button {
  218. background: none;
  219. border: 0;
  220. color: inherit;
  221. font: inherit;
  222. line-height: normal;
  223. overflow: visible;
  224. padding: 0;
  225. -webkit-user-select: none; /* for button */
  226. -moz-user-select: none;
  227. -ms-user-select: none;
  228. }
  229. div.code-toolbar > .toolbar a,
  230. div.code-toolbar > .toolbar button,
  231. div.code-toolbar > .toolbar span {
  232. color: #bbb !important;;
  233. font-size: .8em;
  234. padding: 0 .5em;
  235. background: #f5f2f0 !important;;
  236. background: rgba(224, 224, 224, 0.2);
  237. box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
  238. border-radius: .5em;
  239. }
  240. div.code-toolbar > .toolbar a:hover,
  241. div.code-toolbar > .toolbar a:focus,
  242. div.code-toolbar > .toolbar button:hover,
  243. div.code-toolbar > .toolbar button:focus,
  244. div.code-toolbar > .toolbar span:hover,
  245. div.code-toolbar > .toolbar span:focus {
  246. color: inherit !important;;
  247. text-decoration: none;
  248. }
  249. /**
  250. * 覆盖
  251. */
  252. .custom-code pre, .custom-code pre[class*="language-"] {
  253. line-height: 1 !important;
  254. }