Skip to content

Commit 4dda41e

Browse files
committed
Chroma: Add vs theme to mainframe
This removes the custom render-codeblock as it generated html and class references that would not work with the standard chroma theme generator. We may create another render-codeblock in future, if we require a fully custom theme to render our "fancy codeblocks".
1 parent 26b813c commit 4dda41e

File tree

4 files changed

+93
-31
lines changed

4 files changed

+93
-31
lines changed

assets/css/v2/highlight.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/* Generated using: hugo gen chromastyles --style=vs */
2+
3+
/* Background */ .bg { background-color:#fff; }
4+
/* PreWrapper */ .chroma { background-color:#fff; }
5+
/* Other */ .chroma .x { }
6+
/* Error */ .chroma .err { }
7+
/* CodeLine */ .chroma .cl { }
8+
/* LineLink */ .chroma .lnlinks { outline:none;text-decoration:none;color:inherit }
9+
/* LineTableTD */ .chroma .lntd { vertical-align:top;padding:0;margin:0;border:0; }
10+
/* LineTable */ .chroma .lntable { border-spacing:0;padding:0;margin:0;border:0; }
11+
/* LineHighlight */ .chroma .hl { background-color:#e5e5e5 }
12+
/* 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 }
13+
/* 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 }
14+
/* Line */ .chroma .line { display:flex; }
15+
/* Keyword */ .chroma .k { color:#00f }
16+
/* KeywordConstant */ .chroma .kc { color:#00f }
17+
/* KeywordDeclaration */ .chroma .kd { color:#00f }
18+
/* KeywordNamespace */ .chroma .kn { color:#00f }
19+
/* KeywordPseudo */ .chroma .kp { color:#00f }
20+
/* KeywordReserved */ .chroma .kr { color:#00f }
21+
/* KeywordType */ .chroma .kt { color:#2b91af }
22+
/* Name */ .chroma .n { }
23+
/* NameAttribute */ .chroma .na { }
24+
/* NameBuiltin */ .chroma .nb { }
25+
/* NameBuiltinPseudo */ .chroma .bp { }
26+
/* NameClass */ .chroma .nc { color:#2b91af }
27+
/* NameConstant */ .chroma .no { }
28+
/* NameDecorator */ .chroma .nd { }
29+
/* NameEntity */ .chroma .ni { }
30+
/* NameException */ .chroma .ne { }
31+
/* NameFunction */ .chroma .nf { }
32+
/* NameFunctionMagic */ .chroma .fm { }
33+
/* NameLabel */ .chroma .nl { }
34+
/* NameNamespace */ .chroma .nn { }
35+
/* NameOther */ .chroma .nx { }
36+
/* NameProperty */ .chroma .py { }
37+
/* NameTag */ .chroma .nt { }
38+
/* NameVariable */ .chroma .nv { }
39+
/* NameVariableClass */ .chroma .vc { }
40+
/* NameVariableGlobal */ .chroma .vg { }
41+
/* NameVariableInstance */ .chroma .vi { }
42+
/* NameVariableMagic */ .chroma .vm { }
43+
/* Literal */ .chroma .l { }
44+
/* LiteralDate */ .chroma .ld { }
45+
/* LiteralString */ .chroma .s { color:#a31515 }
46+
/* LiteralStringAffix */ .chroma .sa { color:#a31515 }
47+
/* LiteralStringBacktick */ .chroma .sb { color:#a31515 }
48+
/* LiteralStringChar */ .chroma .sc { color:#a31515 }
49+
/* LiteralStringDelimiter */ .chroma .dl { color:#a31515 }
50+
/* LiteralStringDoc */ .chroma .sd { color:#a31515 }
51+
/* LiteralStringDouble */ .chroma .s2 { color:#a31515 }
52+
/* LiteralStringEscape */ .chroma .se { color:#a31515 }
53+
/* LiteralStringHeredoc */ .chroma .sh { color:#a31515 }
54+
/* LiteralStringInterpol */ .chroma .si { color:#a31515 }
55+
/* LiteralStringOther */ .chroma .sx { color:#a31515 }
56+
/* LiteralStringRegex */ .chroma .sr { color:#a31515 }
57+
/* LiteralStringSingle */ .chroma .s1 { color:#a31515 }
58+
/* LiteralStringSymbol */ .chroma .ss { color:#a31515 }
59+
/* LiteralNumber */ .chroma .m { }
60+
/* LiteralNumberBin */ .chroma .mb { }
61+
/* LiteralNumberFloat */ .chroma .mf { }
62+
/* LiteralNumberHex */ .chroma .mh { }
63+
/* LiteralNumberInteger */ .chroma .mi { }
64+
/* LiteralNumberIntegerLong */ .chroma .il { }
65+
/* LiteralNumberOct */ .chroma .mo { }
66+
/* Operator */ .chroma .o { }
67+
/* OperatorWord */ .chroma .ow { color:#00f }
68+
/* Punctuation */ .chroma .p { }
69+
/* Comment */ .chroma .c { color:#008000 }
70+
/* CommentHashbang */ .chroma .ch { color:#008000 }
71+
/* CommentMultiline */ .chroma .cm { color:#008000 }
72+
/* CommentSingle */ .chroma .c1 { color:#008000 }
73+
/* CommentSpecial */ .chroma .cs { color:#008000 }
74+
/* CommentPreproc */ .chroma .cp { color:#00f }
75+
/* CommentPreprocFile */ .chroma .cpf { color:#00f }
76+
/* Generic */ .chroma .g { }
77+
/* GenericDeleted */ .chroma .gd { }
78+
/* GenericEmph */ .chroma .ge { font-style:italic }
79+
/* GenericError */ .chroma .gr { }
80+
/* GenericHeading */ .chroma .gh { font-weight:bold }
81+
/* GenericInserted */ .chroma .gi { }
82+
/* GenericOutput */ .chroma .go { }
83+
/* GenericPrompt */ .chroma .gp { font-weight:bold }
84+
/* GenericStrong */ .chroma .gs { font-weight:bold }
85+
/* GenericSubheading */ .chroma .gu { font-weight:bold }
86+
/* GenericTraceback */ .chroma .gt { }
87+
/* GenericUnderline */ .chroma .gl { }
88+
/* TextWhitespace */ .chroma .w { }

layouts/_default/_markup/render-codeblock.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

layouts/_default/baseof.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
});
5050

51-
const v2cssIds = ["css7"];
51+
const v2cssIds = ["css7", "css9"];
5252
v2cssIds.forEach((cssId) => {
5353
const element = document.getElementById(cssId);
5454
if (element !== null) {
@@ -75,10 +75,6 @@
7575
table.style.display = isNewTheme ? "none" : "";
7676
});
7777

78-
document.querySelectorAll(".highlight").forEach((codeblock) => {
79-
codeblock.style.display = isNewTheme ? "none" : "";
80-
});
81-
8278
const mfElements = ['[data-mf="true"]'];
8379
mfElements.forEach((elementId) => {
8480
document.querySelectorAll(elementId).forEach((element) => {

layouts/partials/styles.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{ $css6 := resources.Get "css/coveo.css" }}
77
{{ $css7 := resources.Get "css/v2/style.css" }}
88
{{ $css8 := resources.Get "css/inline-overrides.css" }}
9+
{{ $css9 := resources.Get "css/v2/highlight.css" }}
910

1011
<!-- load v2 theme assets -->
1112
<link href="{{ $css7.RelPermalink }}" integrity="{{ $css7.Data.Integrity }}" rel="stylesheet" type="text/css" id="css7"
@@ -14,6 +15,9 @@
1415
{{ $cssInter := resources.Get "css/inter/inter.css" | fingerprint "sha512" }}
1516
<link href="{{ $cssInter.RelPermalink }}" integrity="{{ $cssInter.Data.Integrity }}" rel="stylesheet" type="text/css"
1617
id="cssInter">
18+
19+
{{ $cssHighlight := $css9 | minify | fingerprint "sha512"}}
20+
<link href="{{ $cssHighlight.RelPermalink }}" rel="stylesheet" type="text/css" id="css9">
1721
<!-- end v2 theme assets -->
1822

1923

0 commit comments

Comments
 (0)