Merge pull request #7482 from mgeier/basic-code-blocks

basic theme: CSS spacing for code blocks with captions and line numbers
This commit is contained in:
Takeshi KOMIYA 2020-04-16 01:27:15 +09:00 committed by GitHub
commit e8aeaf26dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -646,21 +646,52 @@ span.pre {
} }
td.linenos pre { td.linenos pre {
padding: 5px 0px;
border: 0; border: 0;
background-color: transparent; background-color: transparent;
color: #aaa; color: #aaa;
} }
table.highlighttable { table.highlighttable {
margin-left: 0.5em; display: block;
margin: 1em 0;
}
table.highlighttable tbody {
display: block;
}
table.highlighttable tr {
display: flex;
} }
table.highlighttable td { table.highlighttable td {
padding: 0 0.5em 0 0.5em; margin: 0;
padding: 0;
}
table.highlighttable td.linenos {
padding: 0 0.5em;
}
table.highlighttable td.code {
flex: 1;
overflow: hidden;
}
.highlight .hll {
display: block;
}
table.highlighttable pre {
margin: 0;
}
div.code-block-caption + div > table.highlighttable {
margin-top: 0;
} }
div.code-block-caption { div.code-block-caption {
margin-top: 1em;
padding: 2px 5px; padding: 2px 5px;
font-size: small; font-size: small;
} }
@ -673,6 +704,7 @@ div.code-block-caption + div > div.highlight > pre {
margin-top: 0; margin-top: 0;
} }
table.highlighttable td.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none; user-select: none;
} }
@ -686,11 +718,7 @@ div.code-block-caption span.caption-text {
} }
div.literal-block-wrapper { div.literal-block-wrapper {
padding: 1em 1em 0; margin: 1em 0;
}
div.literal-block-wrapper div.highlight {
margin: 0;
} }
code.descname { code.descname {