code.css 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. code {
  2. margin: 0;
  3. border-radius: 3px;
  4. padding: 0.25rem 0.5rem;
  5. font-family: var(--code-font-family);
  6. font-size: 0.85em;
  7. color: var(--c-text-light);
  8. background-color: var(--code-inline-bg-color);
  9. }
  10. code .token.deleted {
  11. color: #ec5975;
  12. }
  13. code .token.inserted {
  14. color: var(--c-brand);
  15. }
  16. div[class*='language-'] {
  17. position: relative;
  18. margin: 1rem -1.5rem;
  19. background-color: var(--code-bg-color);
  20. overflow-x: auto;
  21. }
  22. li > div[class*='language-'] {
  23. border-radius: 6px 0 0 6px;
  24. margin: 1rem -1.5rem 1rem -1.25rem;
  25. }
  26. @media (min-width: 420px) {
  27. div[class*='language-'] {
  28. margin: 1rem 0;
  29. border-radius: 6px;
  30. }
  31. li > div[class*='language-'] {
  32. margin: 1rem 0 1rem 0rem;
  33. border-radius: 6px;
  34. }
  35. }
  36. [class*='language-'] pre,
  37. [class*='language-'] code {
  38. text-align: left;
  39. white-space: pre;
  40. word-spacing: normal;
  41. word-break: normal;
  42. word-wrap: normal;
  43. -moz-tab-size: 4;
  44. -o-tab-size: 4;
  45. tab-size: 4;
  46. -webkit-hyphens: none;
  47. -moz-hyphens: none;
  48. -ms-hyphens: none;
  49. hyphens: none;
  50. }
  51. [class*='language-'] pre {
  52. position: relative;
  53. z-index: 1;
  54. margin: 0;
  55. padding: 1.25rem 1.5rem;
  56. background: transparent;
  57. overflow-x: auto;
  58. }
  59. [class*='language-'] code {
  60. padding: 0;
  61. line-height: var(--code-line-height);
  62. font-size: var(--code-font-size);
  63. color: #eee;
  64. }
  65. /* Line highlighting */
  66. .highlight-lines {
  67. position: absolute;
  68. top: 0;
  69. bottom: 0;
  70. left: 0;
  71. padding: 1.25rem 0;
  72. width: 100%;
  73. line-height: var(--code-line-height);
  74. font-family: var(--code-font-family);
  75. font-size: var(--code-font-size);
  76. user-select: none;
  77. overflow: hidden;
  78. }
  79. .highlight-lines .highlighted {
  80. background-color: rgba(0, 0, 0, 0.66);
  81. }
  82. /* Line numbers mode */
  83. div[class*='language-'].line-numbers-mode {
  84. padding-left: 3.5rem;
  85. }
  86. .line-numbers-wrapper {
  87. position: absolute;
  88. top: 0;
  89. bottom: 0;
  90. left: 0;
  91. z-index: 3;
  92. border-right: 1px solid rgba(0, 0, 0, 0.5);
  93. padding: 1.25rem 0;
  94. width: 3.5rem;
  95. text-align: center;
  96. line-height: var(--code-line-height);
  97. font-family: var(--code-font-family);
  98. font-size: var(--code-font-size);
  99. color: #888;
  100. }
  101. /* Language marker */
  102. [class*='language-']:before {
  103. position: absolute;
  104. top: 0.6em;
  105. right: 1em;
  106. z-index: 2;
  107. font-size: 0.8rem;
  108. color: #888;
  109. }
  110. [class~='language-html']:before,
  111. [class~='language-markup']:before {
  112. content: 'html';
  113. }
  114. [class~='language-md']:before,
  115. [class~='language-markdown']:before {
  116. content: 'md';
  117. }
  118. [class~='language-css']:before {
  119. content: 'css';
  120. }
  121. [class~='language-sass']:before {
  122. content: 'sass';
  123. }
  124. [class~='language-scss']:before {
  125. content: 'scss';
  126. }
  127. [class~='language-less']:before {
  128. content: 'less';
  129. }
  130. [class~='language-stylus']:before {
  131. content: 'styl';
  132. }
  133. [class~='language-js']:before,
  134. [class~='language-javascript']:before {
  135. content: 'js';
  136. }
  137. [class~='language-ts']:before,
  138. [class~='language-typescript']:before {
  139. content: 'ts';
  140. }
  141. [class~='language-json']:before {
  142. content: 'json';
  143. }
  144. [class~='language-rb']:before,
  145. [class~='language-ruby']:before {
  146. content: 'rb';
  147. }
  148. [class~='language-py']:before,
  149. [class~='language-python']:before {
  150. content: 'py';
  151. }
  152. [class~='language-sh']:before,
  153. [class~='language-bash']:before {
  154. content: 'sh';
  155. }
  156. [class~='language-php']:before {
  157. content: 'php';
  158. }
  159. [class~='language-go']:before {
  160. content: 'go';
  161. }
  162. [class~='language-rust']:before {
  163. content: 'rust';
  164. }
  165. [class~='language-java']:before {
  166. content: 'java';
  167. }
  168. [class~='language-c']:before {
  169. content: 'c';
  170. }
  171. [class~='language-yaml']:before {
  172. content: 'yaml';
  173. }
  174. [class~='language-dockerfile']:before {
  175. content: 'dockerfile';
  176. }
  177. /**
  178. * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML.
  179. * Based on https://github.com/chriskempson/tomorrow-theme
  180. *
  181. * @author Rose Pritchard
  182. */
  183. .token.comment,
  184. .token.block-comment,
  185. .token.prolog,
  186. .token.doctype,
  187. .token.cdata {
  188. color: #999;
  189. }
  190. .token.punctuation {
  191. color: #ccc;
  192. }
  193. .token.tag,
  194. .token.attr-name,
  195. .token.namespace,
  196. .token.deleted {
  197. color: #e2777a;
  198. }
  199. .token.function-name {
  200. color: #6196cc;
  201. }
  202. .token.boolean,
  203. .token.number,
  204. .token.function {
  205. color: #f08d49;
  206. }
  207. .token.property,
  208. .token.class-name,
  209. .token.constant,
  210. .token.symbol {
  211. color: #f8c555;
  212. }
  213. .token.selector,
  214. .token.important,
  215. .token.atrule,
  216. .token.keyword,
  217. .token.builtin {
  218. color: #cc99cd;
  219. }
  220. .token.string,
  221. .token.char,
  222. .token.attr-value,
  223. .token.regex,
  224. .token.variable {
  225. color: #7ec699;
  226. }
  227. .token.operator,
  228. .token.entity,
  229. .token.url {
  230. color: #67cdcc;
  231. }
  232. .token.important,
  233. .token.bold {
  234. font-weight: bold;
  235. }
  236. .token.italic {
  237. font-style: italic;
  238. }
  239. .token.entity {
  240. cursor: help;
  241. }
  242. .token.inserted {
  243. color: green;
  244. }