Skip to content

Commit ba7fec9

Browse files
[fix] style "/// file: .." pragmas in code blocks
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 parent 0b51466 commit ba7fec9

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/routes/tutorial/[slug]/Sidebar.svelte

+21-3
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,14 @@
121121
margin: 1.5em 0 0.5em 0;
122122
}
123123
124-
.text :global(ul) {
124+
.text :global(ul),
125+
.text :global(ol) {
125126
padding: 0 0 0 2rem;
126127
}
127128
128129
.text :global(code) {
129130
background: hsl(206, 44%, 92%);
130-
padding: 0.2em 0.4em 0.3em;
131+
padding: 0.1em 0.4em 0.2em;
131132
white-space: nowrap;
132133
position: relative;
133134
top: -0.1em;
@@ -149,15 +150,32 @@
149150
background-size: 100% 100%;
150151
}
151152
153+
.text :global(.code-block) :global(h5) {
154+
display: block;
155+
width: 100%;
156+
font-family: var(--font-mono);
157+
font-size: 1.2rem;
158+
font-weight: 400;
159+
padding: 1rem 1rem 0.8rem 1rem;
160+
margin: 0 0 0 0;
161+
color: var(--sk-text-2);
162+
background: var(--back-api);
163+
box-shadow: 0 1px 6px hsla(205.7, 63.6%, 30.8%, 0.06);
164+
border-radius: var(--border-r) var(--border-r) 0 0;
165+
}
166+
152167
.text :global(pre) {
153168
background: white;
154169
padding: 1rem 1.5rem;
155170
margin: 0 0 1.6rem 0;
156171
line-height: 1.3;
157-
border-radius: 0.5rem;
158172
box-shadow: inset 1px 1px 3px hsl(206deg 20% 93%);
159173
}
160174
175+
.text :global(.code-block) :global(h5) + :global(pre) {
176+
border-radius: 0 0 var(--border-r) var(--border-r);
177+
}
178+
161179
.text :global(pre) :global(code) {
162180
background: none;
163181
color: var(--code-base);

0 commit comments

Comments
 (0)