prism.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. .markdown-body {
  2. code[class*="language-"],
  3. pre[class*="language-"] {
  4. color: #f8f8f2;
  5. background: none;
  6. text-shadow: 0 1px rgba(0, 0, 0, 0.3);
  7. font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  8. text-align: left;
  9. white-space: pre;
  10. word-spacing: normal;
  11. word-break: normal;
  12. word-wrap: normal;
  13. line-height: 1.5;
  14. -moz-tab-size: 4;
  15. -o-tab-size: 4;
  16. tab-size: 4;
  17. -webkit-hyphens: none;
  18. -moz-hyphens: none;
  19. -ms-hyphens: none;
  20. hyphens: none;
  21. }
  22. /* Code blocks */
  23. pre[class*="language-"] {
  24. padding: 1em;
  25. margin: 0.5em 0;
  26. overflow: auto;
  27. border-radius: 0.3em;
  28. }
  29. :not(pre) > code[class*="language-"],
  30. pre[class*="language-"] {
  31. background: #282a36;
  32. }
  33. /* Inline code */
  34. :not(pre) > code[class*="language-"] {
  35. padding: 0.1em;
  36. border-radius: 0.3em;
  37. white-space: normal;
  38. }
  39. .token.comment,
  40. .token.prolog,
  41. .token.doctype,
  42. .token.cdata {
  43. color: #6272a4;
  44. }
  45. .token.punctuation {
  46. color: #f8f8f2;
  47. }
  48. .namespace {
  49. opacity: 0.7;
  50. }
  51. .token.property,
  52. .token.tag,
  53. .token.constant,
  54. .token.symbol,
  55. .token.deleted {
  56. color: #ff79c6;
  57. }
  58. .token.boolean,
  59. .token.number {
  60. color: #bd93f9;
  61. }
  62. .token.selector,
  63. .token.attr-name,
  64. .token.string,
  65. .token.char,
  66. .token.builtin,
  67. .token.inserted {
  68. color: #50fa7b;
  69. }
  70. .token.operator,
  71. .token.entity,
  72. .token.url,
  73. .language-css .token.string,
  74. .style .token.string,
  75. .token.variable {
  76. color: #f8f8f2;
  77. }
  78. .token.atrule,
  79. .token.attr-value,
  80. .token.function,
  81. .token.class-name {
  82. color: #f1fa8c;
  83. }
  84. .token.keyword {
  85. color: #8be9fd;
  86. }
  87. .token.regex,
  88. .token.important {
  89. color: #ffb86c;
  90. }
  91. .token.important,
  92. .token.bold {
  93. font-weight: bold;
  94. }
  95. .token.italic {
  96. font-style: italic;
  97. }
  98. .token.entity {
  99. cursor: help;
  100. }
  101. }
  102. @mixin light {
  103. .markdown-body pre[class*="language-"] {
  104. filter: invert(1) hue-rotate(50deg) brightness(1.3);
  105. }
  106. }
  107. @mixin dark {
  108. .markdown-body pre[class*="language-"] {
  109. filter: none;
  110. }
  111. }
  112. :root {
  113. @include light();
  114. }
  115. .light {
  116. @include light();
  117. }
  118. .dark {
  119. @include dark();
  120. }
  121. @media (prefers-color-scheme: dark) {
  122. :root {
  123. @include dark();
  124. }
  125. }