diff options
author | Martin Fischer <martin@push-f.com> | 2025-08-16 21:21:19 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-08-16 22:32:40 +0200 |
commit | 4428200fa4181e5c26253bf8c67cda86951ec754 (patch) | |
tree | 70e6895d6bb6d9a993b086475636324e79355b60 | |
parent | d8e691b2939cde312ea8df6625bd392a83696867 (diff) |
feat: add vscode syntax highlighting
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | assets/css/vscode.css | 180 | ||||
-rw-r--r-- | layouts/partials/head/css.html | 3 |
3 files changed, 185 insertions, 1 deletions
@@ -4,6 +4,9 @@ Tastefejl is a fork of the [Typo] Hugo theme, with the following changes: * Replaced the JavaScript theme switching code with a CSS media query. +* Added VSCode syntax highlighting CSS (also the dark theme which Chroma doesn't include). + You need to configure `markup.highlight.noClasses = false` in your `hugo.toml`. + * The home page embeds `content/home.md` rather than `homeIntroContent` from your `hugo.toml` because Markdown text should be in `.md` files. diff --git a/assets/css/vscode.css b/assets/css/vscode.css new file mode 100644 index 0000000..82fcb37 --- /dev/null +++ b/assets/css/vscode.css @@ -0,0 +1,180 @@ +@media (prefers-color-scheme: dark) { + /* Generated using VS Code Dark Modern theme colors */ + + /* Background */ .bg { background-color:#1F1F1F; } + /* PreWrapper */ .chroma { background-color:#1F1F1F; color:#CCCCCC; } + /* Other */ .chroma .x { color:#D4D4D4; } + /* Error */ .chroma .err { color:#F14C4C; } + /* CodeLine */ .chroma .cl { } + /* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit } + /* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; } + /* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; } + /* LineHighlight */ .chroma .hl { background-color:#212121 } + /* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6E7681 } + /* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6E7681 } + /* Line */ .chroma .line { display:flex; } + /* Keyword */ .chroma .k { color:#569CD6 } + /* KeywordConstant */ .chroma .kc { color:#569CD6 } + /* KeywordDeclaration */ .chroma .kd { color:#569CD6 } + /* KeywordNamespace */ .chroma .kn { color:#569CD6 } + /* KeywordPseudo */ .chroma .kp { color:#569CD6 } + /* KeywordReserved */ .chroma .kr { color:#569CD6 } + /* KeywordType */ .chroma .kt { color:#4EC9B0 } + /* Name */ .chroma .n { color:#9CDCFE } + /* NameAttribute */ .chroma .na { color:#9CDCFE } + /* NameClass */ .chroma .nc { color:#4EC9B0 } + /* NameConstant */ .chroma .no { color:#569CD6 } + /* NameDecorator */ .chroma .nd { color:#DCDCAA } + /* NameEntity */ .chroma .ni { color:#D4D4D4 } + /* NameException */ .chroma .ne { color:#4EC9B0 } + /* NameLabel */ .chroma .nl { color:#9CDCFE } + /* NameNamespace */ .chroma .nn { color:#4EC9B0 } + /* NameOther */ .chroma .nx { color:#9CDCFE } + /* NameProperty */ .chroma .py { color:#9CDCFE } + /* NameTag */ .chroma .nt { color:#569CD6 } + /* NameBuiltin */ .chroma .nb { color:#DCDCAA } + /* NameBuiltinPseudo */ .chroma .bp { color:#DCDCAA } + /* NameVariable */ .chroma .nv { color:#9CDCFE } + /* NameVariableClass */ .chroma .vc { color:#9CDCFE } + /* NameVariableGlobal */ .chroma .vg { color:#9CDCFE } + /* NameVariableInstance */ .chroma .vi { color:#9CDCFE } + /* NameVariableMagic */ .chroma .vm { color:#569CD6 } + /* NameFunction */ .chroma .nf { color:#DCDCAA } + /* NameFunctionMagic */ .chroma .fm { color:#DCDCAA } + /* Literal */ .chroma .l { color:#CE9178 } + /* LiteralDate */ .chroma .ld { color:#CE9178 } + /* LiteralString */ .chroma .s { color:#CE9178 } + /* LiteralStringAffix */ .chroma .sa { color:#CE9178 } + /* LiteralStringBacktick */ .chroma .sb { color:#CE9178 } + /* LiteralStringChar */ .chroma .sc { color:#CE9178 } + /* LiteralStringDelimiter */ .chroma .dl { color:#CE9178 } + /* LiteralStringDoc */ .chroma .sd { color:#CE9178 } + /* LiteralStringDouble */ .chroma .s2 { color:#CE9178 } + /* LiteralStringEscape */ .chroma .se { color:#569CD6 } + /* LiteralStringHeredoc */ .chroma .sh { color:#CE9178 } + /* LiteralStringInterpol */ .chroma .si { color:#CE9178 } + /* LiteralStringOther */ .chroma .sx { color:#CE9178 } + /* LiteralStringRegex */ .chroma .sr { color:#CE9178 } + /* LiteralStringSingle */ .chroma .s1 { color:#CE9178 } + /* LiteralStringSymbol */ .chroma .ss { color:#CE9178 } + /* LiteralNumber */ .chroma .m { color:#B5CEA8 } + /* LiteralNumberBin */ .chroma .mb { color:#B5CEA8 } + /* LiteralNumberFloat */ .chroma .mf { color:#B5CEA8 } + /* LiteralNumberHex */ .chroma .mh { color:#B5CEA8 } + /* LiteralNumberInteger */ .chroma .mi { color:#B5CEA8 } + /* LiteralNumberIntegerLong */ .chroma .il { color:#B5CEA8 } + /* LiteralNumberOct */ .chroma .mo { color:#B5CEA8 } + /* Operator */ .chroma .o { color:#D4D4D4 } + /* OperatorWord */ .chroma .ow { color:#569CD6 } + /* Punctuation */ .chroma .p { color:#808080 } + /* Comment */ .chroma .c { color:#6A9955 } + /* CommentHashbang */ .chroma .ch { color:#6A9955 } + /* CommentMultiline */ .chroma .cm { color:#6A9955 } + /* CommentSingle */ .chroma .c1 { color:#6A9955 } + /* CommentSpecial */ .chroma .cs { color:#6A9955 } + /* CommentPreproc */ .chroma .cp { color:#569CD6 } + /* CommentPreprocFile */ .chroma .cpf { color:#569CD6 } + /* Generic */ .chroma .g { color:#D4D4D4 } + /* GenericDeleted */ .chroma .gd { color:#F85149 } + /* GenericEmph */ .chroma .ge { font-style:italic } + /* GenericError */ .chroma .gr { color:#F14C4C } + /* GenericHeading */ .chroma .gh { font-weight:bold; color:#569CD6 } + /* GenericInserted */ .chroma .gi { color:#73c991 } + /* GenericOutput */ .chroma .go { color:#D4D4D4 } + /* GenericPrompt */ .chroma .gp { font-weight:bold; color:#9CDCFE } + /* GenericStrong */ .chroma .gs { font-weight:bold } + /* GenericSubheading */ .chroma .gu { font-weight:bold; color:#569CD6 } + /* GenericTraceback */ .chroma .gt { color:#F14C4C } + /* GenericUnderline */ .chroma .gl { text-decoration:underline } + /* TextWhitespace */ .chroma .w { color:#D4D4D4 } +} + +@media (prefers-color-scheme: light) { + /* Generated using: hugo gen chromastyles --style=vs */ + /* Background */ .bg { background-color:#fff; } + /* PreWrapper */ .chroma { background-color:#fff; } + /* Other */ .chroma .x { } + /* Error */ .chroma .err { } + /* CodeLine */ .chroma .cl { } + /* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit } + /* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; } + /* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; } + /* LineHighlight */ .chroma .hl { background-color:#e5e5e5 } + /* LineNumbersTable */ .chroma .lnt { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f } + /* LineNumbers */ .chroma .ln { white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f } + /* Line */ .chroma .line { display:flex; } + /* Keyword */ .chroma .k { color:#00f } + /* KeywordConstant */ .chroma .kc { color:#00f } + /* KeywordDeclaration */ .chroma .kd { color:#00f } + /* KeywordNamespace */ .chroma .kn { color:#00f } + /* KeywordPseudo */ .chroma .kp { color:#00f } + /* KeywordReserved */ .chroma .kr { color:#00f } + /* KeywordType */ .chroma .kt { color:#2b91af } + /* Name */ .chroma .n { } + /* NameAttribute */ .chroma .na { } + /* NameClass */ .chroma .nc { color:#2b91af } + /* NameConstant */ .chroma .no { } + /* NameDecorator */ .chroma .nd { } + /* NameEntity */ .chroma .ni { } + /* NameException */ .chroma .ne { } + /* NameLabel */ .chroma .nl { } + /* NameNamespace */ .chroma .nn { } + /* NameOther */ .chroma .nx { } + /* NameProperty */ .chroma .py { } + /* NameTag */ .chroma .nt { } + /* NameBuiltin */ .chroma .nb { } + /* NameBuiltinPseudo */ .chroma .bp { } + /* NameVariable */ .chroma .nv { } + /* NameVariableClass */ .chroma .vc { } + /* NameVariableGlobal */ .chroma .vg { } + /* NameVariableInstance */ .chroma .vi { } + /* NameVariableMagic */ .chroma .vm { } + /* NameFunction */ .chroma .nf { } + /* NameFunctionMagic */ .chroma .fm { } + /* Literal */ .chroma .l { } + /* LiteralDate */ .chroma .ld { } + /* LiteralString */ .chroma .s { color:#a31515 } + /* LiteralStringAffix */ .chroma .sa { color:#a31515 } + /* LiteralStringBacktick */ .chroma .sb { color:#a31515 } + /* LiteralStringChar */ .chroma .sc { color:#a31515 } + /* LiteralStringDelimiter */ .chroma .dl { color:#a31515 } + /* LiteralStringDoc */ .chroma .sd { color:#a31515 } + /* LiteralStringDouble */ .chroma .s2 { color:#a31515 } + /* LiteralStringEscape */ .chroma .se { color:#a31515 } + /* LiteralStringHeredoc */ .chroma .sh { color:#a31515 } + /* LiteralStringInterpol */ .chroma .si { color:#a31515 } + /* LiteralStringOther */ .chroma .sx { color:#a31515 } + /* LiteralStringRegex */ .chroma .sr { color:#a31515 } + /* LiteralStringSingle */ .chroma .s1 { color:#a31515 } + /* LiteralStringSymbol */ .chroma .ss { color:#a31515 } + /* LiteralNumber */ .chroma .m { } + /* LiteralNumberBin */ .chroma .mb { } + /* LiteralNumberFloat */ .chroma .mf { } + /* LiteralNumberHex */ .chroma .mh { } + /* LiteralNumberInteger */ .chroma .mi { } + /* LiteralNumberIntegerLong */ .chroma .il { } + /* LiteralNumberOct */ .chroma .mo { } + /* Operator */ .chroma .o { } + /* OperatorWord */ .chroma .ow { color:#00f } + /* Punctuation */ .chroma .p { } + /* Comment */ .chroma .c { color:#008000 } + /* CommentHashbang */ .chroma .ch { color:#008000 } + /* CommentMultiline */ .chroma .cm { color:#008000 } + /* CommentSingle */ .chroma .c1 { color:#008000 } + /* CommentSpecial */ .chroma .cs { color:#008000 } + /* CommentPreproc */ .chroma .cp { color:#00f } + /* CommentPreprocFile */ .chroma .cpf { color:#00f } + /* Generic */ .chroma .g { } + /* GenericDeleted */ .chroma .gd { } + /* GenericEmph */ .chroma .ge { font-style:italic } + /* GenericError */ .chroma .gr { } + /* GenericHeading */ .chroma .gh { font-weight:bold } + /* GenericInserted */ .chroma .gi { } + /* GenericOutput */ .chroma .go { } + /* GenericPrompt */ .chroma .gp { font-weight:bold } + /* GenericStrong */ .chroma .gs { font-weight:bold } + /* GenericSubheading */ .chroma .gu { font-weight:bold } + /* GenericTraceback */ .chroma .gt { } + /* GenericUnderline */ .chroma .gl { } + /* TextWhitespace */ .chroma .w { } +} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index 09c007b..b7111e7 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -5,6 +5,7 @@ $CSS := slice (resources.Get "css/utils.css") (resources.Get "css/fonts.css") (resources.Get "css/main.css") +(resources.Get "css/vscode.css") (resources.Get "css/custom.css") (resources.Get "css/colors/default.css") }} @@ -23,4 +24,4 @@ $combined := $CSS | fingerprint }} -<link rel="stylesheet" href="{{ $combined.RelPermalink }}" media="all">
\ No newline at end of file +<link rel="stylesheet" href="{{ $combined.RelPermalink }}" media="all"> |