Skip to content

Commit

Permalink
Catppuccin syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPower committed May 21, 2024
1 parent 7f147ad commit b77382b
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 1 deletion.
143 changes: 143 additions & 0 deletions src/prism-catppuccin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/* Generated with http://k88hudson.github.io/syntax-highlighting-theme-generator/www */
/* http://k88hudson.github.io/react-markdocs */
/**
* @author k88hudson
*
* Based on prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
/*********************************************************
* General
*/
pre[class*="language-"],
code[class*="language-"] {
color: #cad3f5;
font-size: 13px;
text-shadow: none;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::selection,
code[class*="language-"]::selection,
pre[class*="language-"]::mozselection,
code[class*="language-"]::mozselection {
text-shadow: none;
background: #5b6078;
}
@media print {
pre[class*="language-"],
code[class*="language-"] {
text-shadow: none;
}
}
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
background: #24273a;
}
:not(pre) > code[class*="language-"] {
padding: .1em .3em;
border-radius: .3em;
color: #ed8796;
background: #24273a;
}
/*********************************************************
* Tokens
*/
.namespace {
opacity: .7;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #6e738d;
}
.token.punctuation {
color: #cad3f5;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #f5a97f;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6da95;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #cad3f5;
background: transparent;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #c6a0f6;
}
.token.function {
color: #8aadf4;
}
.token.regex,
.token.important,
.token.variable {
color: #ed8796;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
/*********************************************************
* Line highlighting
*/
pre[data-line] {
position: relative;
}
pre[class*="language-"] > code[class*="language-"] {
position: relative;
z-index: 1;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em;
background: #363a4f;
box-shadow: inset 5px 0 0 #363a4f;
z-index: 0;
pointer-events: none;
line-height: inherit;
white-space: pre;
}
2 changes: 1 addition & 1 deletion src/routes/page/[page]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { Editor, defaultValueCtx, rootCtx } from "@milkdown/core";
import { commonmark } from "@milkdown/preset-commonmark";
import { prism, prismConfig } from "@milkdown/plugin-prism";
import "prism-themes/themes/prism-dracula.css";
import "../../../prism-catppuccin.css";
import { gfm } from "@milkdown/preset-gfm";
import { listener, listenerCtx } from "@milkdown/plugin-listener";
import { diagram } from "@milkdown/plugin-diagram";
Expand Down

0 comments on commit b77382b

Please sign in to comment.