Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 0dc9127

Browse files
authored
Merge branch 'master' into group_submit
2 parents 1483db5 + 41d4430 commit 0dc9127

1 file changed

Lines changed: 93 additions & 8 deletions

File tree

runestone/common/css/runestone-custom-sphinx-bootstrap.css

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ a {
208208
margin: 0 3px;
209209
border-left: 1px solid #f2f2f2;
210210
}
211-
211+
212212
.navbar-fixed-top .container {
213213
padding: 0;
214214
}
@@ -456,6 +456,92 @@ h2 {
456456
font-weight: normal;
457457
}
458458

459+
/*
460+
Missing brackets
461+
================
462+
The default styling from Sphinx's ``basic.css`` doesn't style multiple references to the same reference with brackets. Here's the relevant snippet of CSS:
463+
464+
.. code-block:: CSS
465+
:number-lines:
466+
467+
a.brackets:before,
468+
span.brackets > a:before{
469+
content: "[";
470+
}
471+
472+
a.brackets:after,
473+
span.brackets > a:after {
474+
content: "]";
475+
}
476+
477+
The HTML for a footnote reference is:
478+
479+
.. code-block:: HTML
480+
:number-lines:
481+
482+
<a class="footnote-reference brackets" href="#assembled" id="id1">2</a>
483+
484+
The HTML for a typical footnote is:
485+
486+
.. code-block:: HTML
487+
:number-lines:
488+
489+
<dl class="footnote brackets">
490+
<dt class="label" id="xxx">
491+
<span class="brackets">
492+
<a class="fn-backref" href="#id2">1</a>
493+
</span>
494+
</dt>
495+
<dd>Omitted this...</dd>
496+
</dl>
497+
498+
The HTML for a footnote referenced multiple times is:
499+
500+
.. code-block:: HTML
501+
:number-lines:
502+
503+
<dl class="footnote brackets">
504+
<dt class="label" id="xxx">
505+
<span class="brackets">1</span>
506+
<span class="fn-backref">
507+
(<a href="#id1">1</a>,<a href="#id2">2</a>,<a href="#id3">3</a>)
508+
</span>
509+
</dt>
510+
<dd>Omitted this...</dd>
511+
</dl>
512+
513+
However, there's no (current) CSS selector that will add a ``content`` to the multiply-referenced footnote without adding an additional ``content`` to the typical footnote: we want to select ``dt.label > span.brackets > text-only content`` or ``dt.label > span.brackets > :not(:has a)`` (see the unsupported `:has selector <https://css-tricks.com/did-you-know-about-the-has-css-selector/>`_. So, I see no solution for this (outside JS).
514+
515+
516+
Incorrect color
517+
===============
518+
Second, the Bootstrap theme (v3.4.1) contains the following CSS, from ``node_modules/bootstrap/dist/css/less/labels.less``:
519+
520+
.. code-block:: CSS
521+
:number-lines:
522+
523+
.label {
524+
display: inline;
525+
padding: .2em .6em .3em;
526+
font-size: 75%;
527+
font-weight: 700;
528+
line-height: 1;
529+
color: @label-color;
530+
text-align: center;
531+
white-space: nowrap;
532+
vertical-align: baseline;
533+
border-radius: .25em;
534+
535+
...more here omitted...
536+
}
537+
538+
ALL this therefore gets applied to footnotes, since they have the ``label`` class. Because the ``@label-color`` is white, this CSS makes the reference invisible against the default (light mode) white background. I like the rest of the styling changes (even though they differ from the standard Sphinx settings), so only the color is changed.
539+
*/
540+
dt.label > span.brackets:not(span.brackets > a),
541+
dt.label > span.fn-backref:not(span.fn-backref > a) {
542+
color: black;
543+
}
544+
459545
/* These admonition styles styles are copied from the Bootstrap .alert classes.
460546
Most of the !important declarations are to override the Sphinx basic.css styles */
461547
.admonition {
@@ -680,11 +766,11 @@ div.flash {
680766

681767
.navLink a {
682768
display: inline-block;
683-
background-color: white;
684-
border-style:solid;
685-
border-color:lightgrey;
686-
border-width:2px;
687-
width:100px;
769+
background-color: white;
770+
border-style:solid;
771+
border-color:lightgrey;
772+
border-width:2px;
773+
width:100px;
688774
height:50px
689775
}
690776

@@ -703,7 +789,7 @@ div.flash {
703789
}
704790

705791
@media (max-width: 600px) {
706-
792+
707793
.navLink {
708794
display: inline-block;
709795
bottom: auto;
@@ -785,7 +871,6 @@ div.flash {
785871

786872
.container .section>div.sidebar {
787873
margin: 0 0 0.5em 1em;
788-
width: auto;
789874
}
790875

791876
a.disqus_thread_link {

0 commit comments

Comments
 (0)