Skip to content

Commit 437f549

Browse files
authored
Merge pull request #124 from NeurodataWithoutBorders/better-code-style
Add code styling for light theme
2 parents ffa5fe9 + 933be47 commit 437f549

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

assets/css/style.css

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,3 +1196,108 @@ a.next-page-btn:hover {
11961196
padding: 30px 0 !important;
11971197
}
11981198
}
1199+
1200+
/* Code Styling - Light Theme */
1201+
1202+
/* Inline code */
1203+
.content code {
1204+
background-color: #f6f8fa !important;
1205+
color: #24292f !important;
1206+
padding: 0.2em 0.4em !important;
1207+
border-radius: 6px !important;
1208+
font-size: 0.9em !important;
1209+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
1210+
border: 1px solid #d0d7de !important;
1211+
}
1212+
1213+
/* Code blocks */
1214+
.content pre {
1215+
background-color: #f6f8fa !important;
1216+
padding: 16px !important;
1217+
border-radius: 6px !important;
1218+
overflow-x: auto !important;
1219+
border: 1px solid #d0d7de !important;
1220+
margin: 1em 0 !important;
1221+
line-height: 1.45 !important;
1222+
}
1223+
1224+
.content pre code {
1225+
background-color: transparent !important;
1226+
padding: 0 !important;
1227+
border: none !important;
1228+
font-size: 0.875em !important;
1229+
color: #24292f !important;
1230+
display: block !important;
1231+
}
1232+
1233+
/* Syntax highlighting - GitHub light theme colors */
1234+
.chroma .err { color: #f85149; } /* Error */
1235+
.chroma .k { color: #cf222e; } /* Keyword */
1236+
.chroma .kc { color: #0550ae; } /* Keyword.Constant */
1237+
.chroma .kd { color: #cf222e; } /* Keyword.Declaration */
1238+
.chroma .kn { color: #cf222e; } /* Keyword.Namespace */
1239+
.chroma .kp { color: #cf222e; } /* Keyword.Pseudo */
1240+
.chroma .kr { color: #cf222e; } /* Keyword.Reserved */
1241+
.chroma .kt { color: #cf222e; } /* Keyword.Type */
1242+
.chroma .n { color: #24292f; } /* Name */
1243+
.chroma .na { color: #24292f; } /* Name.Attribute */
1244+
.chroma .nb { color: #953800; } /* Name.Builtin */
1245+
.chroma .nc { color: #953800; } /* Name.Class */
1246+
.chroma .nf { color: #8250df; } /* Name.Function */
1247+
.chroma .nx { color: #24292f; } /* Name.Other */
1248+
.chroma .nt { color: #116329; } /* Name.Tag */
1249+
.chroma .nv { color: #24292f; } /* Name.Variable */
1250+
.chroma .s { color: #0a3069; } /* String */
1251+
.chroma .sa { color: #0a3069; } /* String.Affix */
1252+
.chroma .sb { color: #0a3069; } /* String.Backtick */
1253+
.chroma .sc { color: #0a3069; } /* String.Char */
1254+
.chroma .dl { color: #0a3069; } /* String.Delimiter */
1255+
.chroma .sd { color: #57606a; } /* String.Doc */
1256+
.chroma .s2 { color: #0a3069; } /* String.Double */
1257+
.chroma .se { color: #0a3069; } /* String.Escape */
1258+
.chroma .sh { color: #0a3069; } /* String.Heredoc */
1259+
.chroma .si { color: #0a3069; } /* String.Interpol */
1260+
.chroma .sx { color: #0a3069; } /* String.Other */
1261+
.chroma .sr { color: #116329; } /* String.Regex */
1262+
.chroma .s1 { color: #0a3069; } /* String.Single */
1263+
.chroma .ss { color: #0a3069; } /* String.Symbol */
1264+
.chroma .m { color: #0550ae; } /* Number */
1265+
.chroma .mb { color: #0550ae; } /* Number.Bin */
1266+
.chroma .mf { color: #0550ae; } /* Number.Float */
1267+
.chroma .mh { color: #0550ae; } /* Number.Hex */
1268+
.chroma .mi { color: #0550ae; } /* Number.Integer */
1269+
.chroma .il { color: #0550ae; } /* Number.Integer.Long */
1270+
.chroma .mo { color: #0550ae; } /* Number.Oct */
1271+
.chroma .o { color: #cf222e; } /* Operator */
1272+
.chroma .ow { color: #cf222e; } /* Operator.Word */
1273+
.chroma .c { color: #57606a; font-style: italic; } /* Comment */
1274+
.chroma .ch { color: #57606a; font-style: italic; } /* Comment.Hashbang */
1275+
.chroma .cm { color: #57606a; font-style: italic; } /* Comment.Multiline */
1276+
.chroma .c1 { color: #57606a; font-style: italic; } /* Comment.Single */
1277+
.chroma .cs { color: #57606a; font-style: italic; } /* Comment.Special */
1278+
.chroma .cp { color: #57606a; font-style: italic; } /* Comment.Preproc */
1279+
.chroma .cpf { color: #57606a; font-style: italic; } /* Comment.PreprocFile */
1280+
.chroma .gd { color: #82071e; background-color: #ffebe9; } /* Generic.Deleted */
1281+
.chroma .gi { color: #116329; background-color: #dafbe1; } /* Generic.Inserted */
1282+
.chroma .gu { color: #953800; } /* Generic.Subheading */
1283+
.chroma .ge { font-style: italic; } /* Generic.Emph */
1284+
.chroma .gs { font-weight: bold; } /* Generic.Strong */
1285+
1286+
/* Scrollbar styling for code blocks */
1287+
.content pre::-webkit-scrollbar {
1288+
height: 8px !important;
1289+
}
1290+
1291+
.content pre::-webkit-scrollbar-track {
1292+
background: #f0f0f0 !important;
1293+
border-radius: 4px !important;
1294+
}
1295+
1296+
.content pre::-webkit-scrollbar-thumb {
1297+
background: #d0d7de !important;
1298+
border-radius: 4px !important;
1299+
}
1300+
1301+
.content pre::-webkit-scrollbar-thumb:hover {
1302+
background: #afb8c1 !important;
1303+
}

hugo.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ markup:
1414
goldmark:
1515
renderer:
1616
unsafe: true
17+
highlight:
18+
style: github
19+
lineNos: false
20+
noClasses: false
1721

1822
# Modules
1923
module:

0 commit comments

Comments
 (0)