Skip to content

Commit 695a4e1

Browse files
Blendifybenjaomingnienn
authored
Update Breadcrumb Styles (readthedocs#1073)
* Update Breadcrumb Styles - Fixes extra padding to the left/right - Used slash instead of >> - Make literalls match other link style - Adds demo docs for testing * Update comment * Update src/sass/_theme_breadcrumbs.sass Co-authored-by: Ana Costa <anacosta.xl@gmail.com> * Build theme.css for readthedocs#1073 * Build theme.css for readthedocs#1073 Co-authored-by: Benjamin Bach <benjamin@overtag.dk> Co-authored-by: Ana Costa <anacosta.xl@gmail.com>
1 parent ba0dc62 commit 695a4e1

10 files changed

Lines changed: 71 additions & 15 deletions

File tree

‎docs/demo/level1/index.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
******************
3+
Breadcrumb Level 1
4+
******************
5+
6+
.. toctree::
7+
:maxdepth: 3
8+
9+
level2/index.rst

‎docs/demo/level1/level2/index.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
******************************************
3+
:mod:`Breadcrumb Level 2 <test_py_module>`
4+
******************************************
5+
6+
.. toctree::
7+
:maxdepth: 3
8+
9+
level3/index.rst
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
******************
3+
Breadcrumb Level 3
4+
******************
5+
6+
.. toctree::
7+
:maxdepth: 3
8+
9+
level4/index.rst
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
******************
3+
Breadcrumb Level 4
4+
******************
5+
6+
.. toctree::
7+
:maxdepth: 3
8+
9+
level5/index.rst
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
******************
3+
Breadcrumb Level 5
4+
******************
5+
6+
.. toctree::
7+
:maxdepth: 3
8+
9+
level6/index.rst
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
******************
3+
Breadcrumb Level 6
4+
******************

‎docs/index.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,9 @@ Development
8282
:hidden:
8383

8484
demo/long
85+
86+
.. toctree::
87+
:maxdepth: 3
88+
:caption: Breadcrumbs
89+
90+
demo/level1/index.rst

‎sphinx_rtd_theme/breadcrumbs.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
<div role="navigation" aria-label="{{ _('Page navigation') }}">
2323
<ul class="wy-breadcrumbs">
2424
{%- block breadcrumbs %}
25-
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
25+
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a></li>
2626
{%- for doc in parents %}
27-
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
27+
<li class="breadcrumb-item"><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
2828
{%- endfor %}
29-
<li>{{ title }}</li>
29+
<li class="breadcrumb-item active">{{ title }}</li>
3030
{%- endblock %}
3131
{%- block breadcrumbs_aside %}
3232
<li class="wy-breadcrumbs-aside">

‎sphinx_rtd_theme/static/css/theme.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/sass/_theme_breadcrumbs.sass‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
.wy-breadcrumbs
22
+clearfix
33

4-
.wy-breadcrumbs li
4+
.wy-breadcrumbs > li
55
display: inline-block
6+
padding-top: 5px
67
&.wy-breadcrumbs-aside
78
float: right
8-
a
9-
display: inline-block
10-
padding: 5px
11-
&:first-child
12-
padding-left: 0
9+
/* Style literals as links */
1310
code
14-
padding: 5px
15-
border: none
16-
background: none
17-
&.literal
18-
color: $text-color
11+
all: inherit
12+
color: inherit
13+
14+
.breadcrumb-item::before
15+
content: "/"
16+
color: #bbb
17+
font-size: 13px
18+
padding: 0 6px 0 3px
19+
1920
.wy-breadcrumbs-extra
2021
margin-bottom: 0
2122
color: $text-light

0 commit comments

Comments
 (0)