add style for PL badges

This commit is contained in:
2025-11-20 17:26:50 +01:00
parent 7f94201212
commit 64bbaac403
2 changed files with 46 additions and 3 deletions

View File

@@ -7,6 +7,19 @@ import djot from "@djot/djot";
const site = lume(); const site = lume();
site.filter("lowercasePL", (lang: string) => {
switch (lang) {
case "C++":
return "cpp";
case "C#":
return "csharp";
case "Python 3":
return "python3";
default:
return lang.toLowerCase();
}
});
site.use(nav()); site.use(nav());
site.use(codeHighlight()); site.use(codeHighlight());

View File

@@ -95,9 +95,39 @@ footer {
} }
.pl-badge { .pl-badge {
border: 1px solid; --color: var(--color-foreground);
border-radius: 8px; border-radius: 8px;
padding: 0.5em; padding: 0em 0.5em;
margin: 0.25em; margin: 0em;
display: inline-block; display: inline-block;
font-size: 0.9em;
background: color-mix(in srgb, var(--color), transparent 60%);
color: var(--color);
}
.pl-python3 {
--color: goldenrod;
background: color-mix(in srgb, gold, transparent 60%);
}
.pl-cpp {
--color: blue;
}
.pl-csharp {
--color: purple;
}
.pl-rust {
--color: orangered;
}
/* An icon to be displayed within text, at the same size as the text */
.text-icon {
height: 1em;
width: 1em;
display: inline;
fill: var(--color-foreground);
position: relative;
top: .125em;
} }