fix code snippet styling

This commit is contained in:
Aravinth Manivannan 2021-12-09 11:36:26 +05:30
parent 5d46ef3a58
commit 6424c85b98
Signed by untrusted user: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 20 additions and 3 deletions

View file

@ -1,8 +1,10 @@
<. let gist_id = data.get_gist_id(src); .> <. let gist_id = data.get_gist_id(src); .>
<. let (_, gist)= gists.as_ref().unwrap().iter().find(|(id, _)| id == gist_id).as_ref().unwrap(); .> <. let (_, gist)= gists.as_ref().unwrap().iter().find(|(id, _)| id == gist_id).as_ref().unwrap(); .>
<div class="gist_container">
<. for file in &gist.files {.> <. for file in &gist.files {.>
<code> <.= file.get_html_content() .> </code> <code class="code-block"> <.= file.get_html_content() .> </code>
<.}.> <.}.>
<a href="<.= &gist.html_url .>" target="_blank" <a class="gist_link" href="<.= &gist.html_url .>" target="_blank"
>See gist on GitHub</a >See gist on GitHub</a
> >
</div>

View file

@ -63,9 +63,15 @@ code {
font-family: monospace; font-family: monospace;
font-size: 15px; font-size: 15px;
white-space: pre-wrap; white-space: pre-wrap;
display: block;
font-weight: 600; font-weight: 600;
line-height: 1rem; line-height: 1rem;
padding: 5px;
border-radius: 6px;
background-color: rgba(175, 184, 193, 0.2);
}
.code-block {
display: block;
} }
iframe { iframe {
@ -118,3 +124,12 @@ iframe {
.meta { .meta {
display: inline-flex; display: inline-flex;
} }
.gist_contianer {
border-radius: 6px;
border: 1px solid rgb(211, 211, 211);
}
.gist_link {
margin-left: 5px;
}