feat: upgrade rehype-prism-plus and add default diff css

This commit is contained in:
Timothy Lin
2021-11-19 00:00:18 +08:00
parent d384d1a309
commit 9053ca177c
4 changed files with 52 additions and 18 deletions

View File

@ -313,11 +313,23 @@ sum = parseInt(num1) + parseInt(num2) // "+" means "add"
alert('Sum = ' + sum) // "+" means combine into a string
```
To modify the styles, change the following class selectors in the `tailwind.css` file:
To modify the styles, change the following class selectors in the `prism.css` file:
```css
.code-highlight {
@apply float-left min-w-full;
}
.code-line {
@apply pl-4 -mx-4 border-l-4 border-gray-800;
@apply block pl-4 pr-4 -mx-4 border-l-4 border-opacity-0;
}
.code-line.inserted {
@apply bg-green-500 bg-opacity-20;
}
.code-line.deleted {
@apply bg-red-500 bg-opacity-20;
}
.highlight-line {
@ -325,7 +337,7 @@ To modify the styles, change the following class selectors in the `tailwind.css`
}
.line-number::before {
@apply pr-4 -ml-2 text-gray-400;
@apply inline-block w-4 mr-4 -ml-2 text-right text-gray-400;
content: attr(line);
}
```