0.2.4 • Published 2 years ago

prism-theme-vars v0.2.4

Weekly downloads
384
License
MIT
Repository
github
Last release
2 years ago

Prism --theme-vars

A customizable Prism.js theme using CSS variables

NPM version

🌈 Live Playground

Usage

npm i prism-theme-vars
import 'prism-theme-vars/base.css'

or

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-theme-vars/base.css">

Configuration

Add CSS variables in your CSS, For example:

@import "prism-theme-vars/base.css";

:root {
  --prism-foreground: #393a34;
  --prism-background: #fbfbfb;
  --prism-comment: #b8c4b8;
  --prism-string: #c67b5d;
  --prism-literal: #3a9c9b;
  --prism-keyword: #248459;
  --prism-function: #849145;
  --prism-deleted: #a14f55;
  --prism-class: #2b91af;
  --prism-builtin: #a52727;
  --prism-property: #ad502b;
  --prism-namespace: #c96880;
  --prism-punctuation: #8e8f8b;
  --prism-decorator: #bd8f8f;
  --prism-json-property: #698c96;
}

See base.css for more options avaliable.

Built-in Themes

We have a few themes variables built-in that you can directly use.

@import "prism-theme-vars/base.css";
@import "prism-theme-vars/themes/vitesse-light.css";

/* Overrides */
:root {
  --prism-background: #ffffff;
}

See all themes avaliable under themes/*. Contributions are also greatly welcome!

Work with codemirror-theme-vars

@import "prism-theme-vars/base.css";
@import "prism-theme-vars/to-codemirror.css";

/* --prism prefix will alias to --cm automatically */
:root {
  --prism-foreground: #393a34;
  --prism-background: #fbfbfb;
}

Dark mode

Here is an example of Tailwind CSS favored dark mode support.

html:not(.dark) {
  --prism-foreground: #393a34;
  --prism-background: #f8f8f8;

  --prism-comment: #758575;
  --prism-namespace: #444444;
  --prism-string: #bc8671;
  --prism-punctuation: #80817d;
  --prism-literal: #36acaa;
  --prism-keyword: #248459;
  --prism-function: #849145;
  --prism-deleted: #9a050f;
  --prism-class: #2b91af;
  --prism-builtin: #800000;
  --prism-property: #ce9178;
  --prism-regex: #ad502b;
}

html.dark {
  --prism-foreground: #d4d4d4;
  --prism-background: #1e1e1e;

  --prism-namespace: #aaaaaa;
  --prism-comment: #758575;
  --prism-namespace: #444444;
  --prism-string: #ce9178;
  --prism-punctuation: #d4d4d4;
  --prism-literal: #36acaa;
  --prism-keyword: #38a776;
  --prism-function: #dcdcaa;
  --prism-deleted: #9a050f;
  --prism-class: #4ec9b0;
  --prism-builtin: #d16969;
  --prism-property: #ce9178;
  --prism-regex: #ad502b;
}

License

MIT

slidev-theme-cabbageslidev-theme-cucslidevnubo-sites@everything-registry/sub-chunk-2474vvv-micro-web-appswaset@infinitebrahmanuniverse/nolb-pris@fishdesign-ui/docs@docus/blog-theme-edge@docus/theme@docus/theme-edge@daotl/vue-components@waset/watest@mudssky/slidev-theme-default@mt-plugin/mt-plugin-demo-component@mr-huang/vuepress-theme-weaselaslideslidev-theme-slidev-modern-techhmf-componentsucheon-chartslidev-theme-dyteslidev-theme-dyte-vaibhavshnslidev-theme-easyslidev-theme-eaviseslidev-theme-eclipseslidev-theme-ehl2022slidev-theme-elocslidev-theme-envekslidev-theme-excelseaslidev-theme-fhaachenslidev-theme-flyingstudioslidev-theme-frankfurtslidev-theme-friendlyslidev-theme-geistslidev-theme-genericslidev-theme-greycatslidev-theme-happyslidev-theme-hepslidev-theme-hexletslidev-theme-hexoslidev-theme-hpenguinslidev-theme-antfu-vite-conf-2023slidev-theme-atcslidev-theme-audioshakeslidev-theme-bestonyslidev-theme-betaslidev-theme-bitnateslidev-theme-boltslidev-theme-bscslidev-theme-capgeminislidev-theme-codegslidev-theme-cucslidev-theme-dashengslidev-theme-datev-sccslidev-theme-demateslidev-theme-denkwerkslidev-theme-diapositivslidev-theme-dimsamslidev-theme-divriotsslidev-theme-doctolibslidev-theme-dotnet-junkieslidev-theme-draculaslidev-theme-spezislidev-theme-sprinteinsslidev-theme-stordahlslidev-theme-storyblokslidev-theme-takahashislidev-theme-teach-rsslidev-theme-telefonicaslidev-theme-testslidev-theme-the-unnamedslidev-theme-thinktectureslidev-theme-tpmslidev-theme-ucasslidev-theme-ustcslidev-theme-webhhslidev-theme-webksdeslidev-theme-wordmanslidev-theme-yasio-devslidev-theme-ynnslidev-theme-zero-slideslidev-theme-hydra-confslidev-theme-i18nslidev-theme-imatechslidev-theme-iodigitalslidev-theme-jhqslidev-theme-kageslidev-theme-kolaente-basicslidev-theme-lamdaslidev-theme-lecture-slidesslidev-theme-meetupslidev-theme-modern-techslidev-theme-monoslidev-theme-movistarslidev-theme-mtximuslidev-theme-myownprussianblueslidev-theme-nahco314slidev-theme-nearformslidev-theme-neonslidev-theme-netlify
0.2.3

2 years ago

0.2.4

2 years ago

0.2.1

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.4

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.0.3

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago