版博士V2.0程序
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. # Prism <samp>--theme-vars</samp>
  2. A customizable Prism.js theme using CSS variables
  3. [![NPM version](https://img.shields.io/npm/v/prism-theme-vars?color=a1b858)](https://www.npmjs.com/package/prism-theme-vars)
  4. [🌈 **Live Playground**](https://prism-theme-vars.netlify.app/)
  5. - [codemirror-theme-vars](https://github.com/antfu/codemirror-theme-vars)
  6. ## Usage
  7. ```bash
  8. npm i prism-theme-vars
  9. ```
  10. ```ts
  11. import 'prism-theme-vars/base.css'
  12. ```
  13. or
  14. ```html
  15. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-theme-vars/base.css">
  16. ```
  17. ## Configuration
  18. Add CSS variables in your CSS, For example:
  19. ```css
  20. @import "prism-theme-vars/base.css";
  21. :root {
  22. --prism-foreground: #393a34;
  23. --prism-background: #fbfbfb;
  24. --prism-comment: #b8c4b8;
  25. --prism-string: #c67b5d;
  26. --prism-literal: #3a9c9b;
  27. --prism-keyword: #248459;
  28. --prism-function: #849145;
  29. --prism-deleted: #a14f55;
  30. --prism-class: #2b91af;
  31. --prism-builtin: #a52727;
  32. --prism-property: #ad502b;
  33. --prism-namespace: #c96880;
  34. --prism-punctuation: #8e8f8b;
  35. --prism-decorator: #bd8f8f;
  36. --prism-json-property: #698c96;
  37. }
  38. ```
  39. See [base.css](./base.css) for more options avaliable.
  40. ### Built-in Themes
  41. We have a few themes variables built-in that you can directly use.
  42. ```css
  43. @import "prism-theme-vars/base.css";
  44. @import "prism-theme-vars/themes/vitesse-light.css";
  45. /* Overrides */
  46. :root {
  47. --prism-background: #ffffff;
  48. }
  49. ```
  50. See all themes avaliable under [themes/*](./themes). Contributions are also greatly welcome!
  51. ### Work with `codemirror-theme-vars`
  52. ```css
  53. @import "prism-theme-vars/base.css";
  54. @import "prism-theme-vars/to-codemirror.css";
  55. /* --prism prefix will alias to --cm automatically */
  56. :root {
  57. --prism-foreground: #393a34;
  58. --prism-background: #fbfbfb;
  59. }
  60. ```
  61. ### Dark mode
  62. Here is an example of Tailwind CSS favored dark mode support.
  63. ```css
  64. html:not(.dark) {
  65. --prism-foreground: #393a34;
  66. --prism-background: #f8f8f8;
  67. --prism-comment: #758575;
  68. --prism-namespace: #444444;
  69. --prism-string: #bc8671;
  70. --prism-punctuation: #80817d;
  71. --prism-literal: #36acaa;
  72. --prism-keyword: #248459;
  73. --prism-function: #849145;
  74. --prism-deleted: #9a050f;
  75. --prism-class: #2b91af;
  76. --prism-builtin: #800000;
  77. --prism-property: #ce9178;
  78. --prism-regex: #ad502b;
  79. }
  80. html.dark {
  81. --prism-foreground: #d4d4d4;
  82. --prism-background: #1e1e1e;
  83. --prism-namespace: #aaaaaa;
  84. --prism-comment: #758575;
  85. --prism-namespace: #444444;
  86. --prism-string: #ce9178;
  87. --prism-punctuation: #d4d4d4;
  88. --prism-literal: #36acaa;
  89. --prism-keyword: #38a776;
  90. --prism-function: #dcdcaa;
  91. --prism-deleted: #9a050f;
  92. --prism-class: #4ec9b0;
  93. --prism-builtin: #d16969;
  94. --prism-property: #ce9178;
  95. --prism-regex: #ad502b;
  96. }
  97. ```
  98. ## License
  99. MIT