Skip to content

Commit 495fdd9

Browse files
authored
Merge pull request #178 from NathanaelFetue/fix/code-filename-labels
fix: add filename label support for <code> blocks
2 parents 549e9f2 + 853d587 commit 495fdd9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

assets/scss/_styles_project.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,27 @@ body {
100100
border-top-right-radius: 0;
101101
}
102102

103+
// Support for plain <code> blocks with filename attribute
104+
code[filename] {
105+
display: block;
106+
margin-top: 2rem;
107+
}
108+
109+
code[filename]::before {
110+
content: attr(filename);
111+
display: block;
112+
padding: 0.5rem 0.75rem;
113+
font-size: 0.85rem;
114+
font-weight: 600;
115+
line-height: 1.2;
116+
color: #5f6b7a;
117+
background: #eef3fb;
118+
border: 1px solid var(--bs-border-color);
119+
border-bottom: 0;
120+
border-top-left-radius: 0.5rem;
121+
border-top-right-radius: 0.5rem;
122+
}
123+
103124
img,
104125
.md__image img,
105126
img.md-image-responsive {

0 commit comments

Comments
 (0)