What makes it different? The difference in code is only to add “prism”
attribute and “dark” class, which is optional.
<pre prism class="dark">
var x = 1;
var y = 2;
</pre>
Here are the steps needed to use prism
component in your app.
- Install
prismjs
- Add prism theme style to your
style.css
- Add
prismjs
to yourapp.module.ts
- Create
prism.component.ts
- Done
1. Install prismjs
$ npm install prismjs --save-dev
2. Add prism theme style to your style.css
@import "~prismjs/themes/prism-dark.css";
Available theme css;
- prism-coy.css
- prism-dark.css
- prism-funky.css
- prism-solarizedlight.css