Skip to content

Commit

Permalink
Merge pull request #7657 from mgeier/css-margins
Browse files Browse the repository at this point in the history
basic theme: CSS margin overhaul
  • Loading branch information
tk0miya authored Jun 7, 2020
2 parents 7fa47e4 + 810f37c commit 2ed2085
Showing 1 changed file with 48 additions and 19 deletions.
67 changes: 48 additions & 19 deletions sphinx/themes/basic/static/basic.css_t
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ img.align-default, .figure.align-default {
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px 7px 0 7px;
padding: 7px;
background-color: #ffe;
width: 40%;
float: right;
Expand All @@ -336,7 +336,7 @@ div.admonition, div.topic, pre, div[class|="highlight"] {

div.topic {
border: 1px solid #ccc;
padding: 7px 7px 0 7px;
padding: 7px;
margin: 10px 0 10px 0;
overflow-x: auto;
}
Expand All @@ -360,10 +360,6 @@ div.admonition dt {
font-weight: bold;
}

div.admonition dl {
margin-bottom: 0;
}

p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
Expand All @@ -374,6 +370,14 @@ div.body p.centered {
margin-top: 25px;
}

/* -- content of sidebars/topics/admonitions -------------------------------- */

div.sidebar > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}

/* -- tables ---------------------------------------------------------------- */

table.docutils {
Expand Down Expand Up @@ -426,13 +430,13 @@ table.citation td {
border-bottom: none;
}

th > p:first-child,
td > p:first-child {
th > :first-child,
td > :first-child {
margin-top: 0px;
}

th > p:last-child,
td > p:last-child {
th > :last-child,
td > :last-child {
margin-bottom: 0px;
}

Expand Down Expand Up @@ -478,6 +482,10 @@ table.field-list td, table.field-list th {

/* -- hlist styles ---------------------------------------------------------- */

table.hlist {
margin: 1em 0;
}

table.hlist td {
vertical-align: top;
}
Expand Down Expand Up @@ -505,14 +513,30 @@ ol.upperroman {
list-style: upper-roman;
}

li > p:first-child {
ol > li:first-child > :first-child,
ul > li:first-child > :first-child {
margin-top: 0px;
}

li > p:last-child {
ol ol > li:first-child > :first-child,
ol ul > li:first-child > :first-child,
ul ol > li:first-child > :first-child,
ul ul > li:first-child > :first-child {
margin-top: revert;
}

ol > li:last-child > :last-child,
ul > li:last-child > :last-child {
margin-bottom: 0px;
}

ol ol > li:last-child > :last-child,
ol ul > li:last-child > :last-child,
ul ol > li:last-child > :last-child,
ul ul > li:last-child > :last-child {
margin-bottom: revert;
}

dl.footnote > dt,
dl.citation > dt {
float: left;
Expand Down Expand Up @@ -557,7 +581,7 @@ dl {
margin-bottom: 15px;
}

dd > p:first-child {
dd > :first-child {
margin-top: 0px;
}

Expand All @@ -571,6 +595,11 @@ dd {
margin-left: 30px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
}

dt:target, span.highlighted {
background-color: #fbe54e;
}
Expand Down Expand Up @@ -655,6 +684,10 @@ span.pre {
hyphens: none;
}

div[class^="highlight-"] {
margin: 1em 0;
}

td.linenos pre {
border: 0;
background-color: transparent;
Expand All @@ -663,7 +696,6 @@ td.linenos pre {

table.highlighttable {
display: block;
margin: 1em 0;
}

table.highlighttable tbody {
Expand Down Expand Up @@ -692,11 +724,12 @@ table.highlighttable td.code {
display: block;
}

div.highlight pre,
table.highlighttable pre {
margin: 0;
}

div.code-block-caption + div > table.highlighttable {
div.code-block-caption + div {
margin-top: 0;
}

Expand All @@ -710,10 +743,6 @@ div.code-block-caption code {
background-color: transparent;
}

div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}

table.highlighttable td.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
Expand Down

0 comments on commit 2ed2085

Please sign in to comment.