chore: switched to embedded method for sipp theme de01add0
Steve Simkins · 2026-05-20 22:51 2 file(s) · +67 −94
apps/sipp/server/server.go +67 −2
30 30
//go:embed templates/*.html static/*
31 31
var appFS embed.FS
32 32
33 +
var siteStyle = chroma.MustNewStyle("site", chroma.StyleEntries{
34 +
	chroma.Background:      "#c1c1c1 bg:#121113",
35 +
	chroma.Comment:         "italic #888888",
36 +
	chroma.CommentHashbang: "italic #888888",
37 +
	chroma.CommentMultiline: "italic #888888",
38 +
	chroma.CommentSingle:   "italic #888888",
39 +
	chroma.CommentSpecial:  "italic #888888",
40 +
	chroma.CommentPreproc:  "italic #888888",
41 +
	chroma.Keyword:         "#e78a53",
42 +
	chroma.KeywordConstant: "#e78a53",
43 +
	chroma.KeywordDeclaration: "#e78a53",
44 +
	chroma.KeywordNamespace: "#e78a53",
45 +
	chroma.KeywordPseudo:   "#e78a53",
46 +
	chroma.KeywordReserved: "#e78a53",
47 +
	chroma.KeywordType:     "#e78a53",
48 +
	chroma.LiteralString:           "#fbcb97",
49 +
	chroma.LiteralStringAffix:      "#fbcb97",
50 +
	chroma.LiteralStringBacktick:   "#fbcb97",
51 +
	chroma.LiteralStringChar:       "#fbcb97",
52 +
	chroma.LiteralStringDelimiter:  "#fbcb97",
53 +
	chroma.LiteralStringDoc:        "#fbcb97",
54 +
	chroma.LiteralStringDouble:     "#fbcb97",
55 +
	chroma.LiteralStringEscape:     "#fbcb97",
56 +
	chroma.LiteralStringHeredoc:    "#fbcb97",
57 +
	chroma.LiteralStringInterpol:   "#fbcb97",
58 +
	chroma.LiteralStringOther:      "#fbcb97",
59 +
	chroma.LiteralStringRegex:      "#fbcb97",
60 +
	chroma.LiteralStringSingle:     "#fbcb97",
61 +
	chroma.LiteralStringSymbol:     "#fbcb97",
62 +
	chroma.LiteralNumber:           "#e78a53",
63 +
	chroma.LiteralNumberBin:        "#e78a53",
64 +
	chroma.LiteralNumberFloat:      "#e78a53",
65 +
	chroma.LiteralNumberHex:        "#e78a53",
66 +
	chroma.LiteralNumberInteger:    "#e78a53",
67 +
	chroma.LiteralNumberIntegerLong: "#e78a53",
68 +
	chroma.LiteralNumberOct:        "#e78a53",
69 +
	chroma.NameFunction:    "#5f8787",
70 +
	chroma.NameFunctionMagic: "#5f8787",
71 +
	chroma.NameClass:       "#5f8787",
72 +
	chroma.NameNamespace:   "#5f8787",
73 +
	chroma.NameConstant:    "#5f8787",
74 +
	chroma.NameDecorator:   "#5f8787",
75 +
	chroma.NameBuiltin:     "#fbcb97",
76 +
	chroma.NameBuiltinPseudo: "#fbcb97",
77 +
	chroma.NameAttribute:   "#5f8787",
78 +
	chroma.NameTag:         "#e78a53",
79 +
	chroma.NameVariable:    "#c1c1c1",
80 +
	chroma.NameVariableClass: "#c1c1c1",
81 +
	chroma.NameVariableGlobal: "#c1c1c1",
82 +
	chroma.NameVariableInstance: "#c1c1c1",
83 +
	chroma.NameOther:       "#c1c1c1",
84 +
	chroma.Operator:        "#aaaaaa",
85 +
	chroma.OperatorWord:    "#aaaaaa",
86 +
	chroma.Punctuation:     "#aaaaaa",
87 +
	chroma.GenericDeleted:  "#e78a53",
88 +
	chroma.GenericInserted: "#5f8787",
89 +
	chroma.GenericHeading:  "bold #fbcb97",
90 +
	chroma.GenericSubheading: "bold #fbcb97",
91 +
	chroma.GenericEmph:     "italic",
92 +
	chroma.GenericStrong:   "bold",
93 +
	chroma.Error:           "#e78a53",
94 +
	chroma.LineNumbers:     "#999999",
95 +
	chroma.LineNumbersTable: "#999999",
96 +
})
97 +
33 98
type Snippet = store.Snippet
34 99
35 100
type App struct {
74 139
	if lexer == nil {
75 140
		lexer = lexers.Fallback
76 141
	}
77 -
	style := styles.Get("monokai")
142 +
	style := siteStyle
78 143
	if style == nil {
79 144
		style = styles.Fallback
80 145
	}
81 -
	formatter := html.New(html.Standalone(false), html.WithClasses(true))
146 +
	formatter := html.New(html.Standalone(false), html.WithClasses(false))
82 147
	iterator, err := lexer.Tokenise(nil, content)
83 148
	if err != nil {
84 149
		escaped := strings.NewReplacer("&", "&amp;", "<", "&lt;", ">", "&gt;").Replace(content)
apps/sipp/server/static/styles.css +0 −92
67 67
  border: none;
68 68
}
69 69
70 -
/* Chroma syntax highlighting — custom ansi palette */
71 -
72 -
:root {
73 -
  --ansi0: #121113;
74 -
  --ansi1: #5f8787;
75 -
  --ansi2: #fbcb97;
76 -
  --ansi3: #e78a53;
77 -
  --ansi4: #888888;
78 -
  --ansi5: #999999;
79 -
  --ansi6: #aaaaaa;
80 -
  --ansi7: #c1c1c1;
81 -
}
82 -
83 -
.chroma {
84 -
  background: var(--ansi0);
85 -
  color: var(--ansi7);
86 -
}
87 -
88 -
.chroma .c,
89 -
.chroma .ch,
90 -
.chroma .cm,
91 -
.chroma .c1,
92 -
.chroma .cs,
93 -
.chroma .cp,
94 -
.chroma .cpf { color: var(--ansi4); font-style: italic; }
95 -
96 -
.chroma .k,
97 -
.chroma .kc,
98 -
.chroma .kd,
99 -
.chroma .kn,
100 -
.chroma .kp,
101 -
.chroma .kr,
102 -
.chroma .kt { color: var(--ansi3); }
103 -
104 -
.chroma .s,
105 -
.chroma .sa,
106 -
.chroma .sb,
107 -
.chroma .sc,
108 -
.chroma .dl,
109 -
.chroma .sd,
110 -
.chroma .s2,
111 -
.chroma .se,
112 -
.chroma .sh,
113 -
.chroma .si,
114 -
.chroma .sx,
115 -
.chroma .sr,
116 -
.chroma .s1,
117 -
.chroma .ss { color: var(--ansi2); }
118 -
119 -
.chroma .m,
120 -
.chroma .mb,
121 -
.chroma .mf,
122 -
.chroma .mh,
123 -
.chroma .mi,
124 -
.chroma .il,
125 -
.chroma .mo { color: var(--ansi3); }
126 -
127 -
.chroma .nf,
128 -
.chroma .fm { color: var(--ansi1); }
129 -
130 -
.chroma .nc,
131 -
.chroma .nn,
132 -
.chroma .no,
133 -
.chroma .nd { color: var(--ansi1); }
134 -
135 -
.chroma .nb,
136 -
.chroma .bp { color: var(--ansi2); }
137 -
138 -
.chroma .n,
139 -
.chroma .nv,
140 -
.chroma .vc,
141 -
.chroma .vg,
142 -
.chroma .vi,
143 -
.chroma .nx,
144 -
.chroma .py { color: var(--ansi7); }
145 -
146 -
.chroma .o,
147 -
.chroma .ow,
148 -
.chroma .p { color: var(--ansi6); }
149 -
150 -
.chroma .nt { color: var(--ansi3); }
151 -
.chroma .na { color: var(--ansi1); }
152 -
153 -
.chroma .err { color: var(--ansi3); background: transparent; }
154 -
155 -
.chroma .gd { color: var(--ansi3); }
156 -
.chroma .gi { color: var(--ansi1); }
157 -
.chroma .gh { color: var(--ansi2); font-weight: bold; }
158 -
159 -
.chroma .ln,
160 -
.chroma .lnt { color: var(--ansi5); }
161 -
162 70
/* Viewer action row */
163 71
164 72
.button-group {