Skip to content

Commit

Permalink
Update Breadcrumb Styles (#1073)
Browse files Browse the repository at this point in the history
* 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 #1073

* Build theme.css for #1073

Co-authored-by: Benjamin Bach <benjamin@overtag.dk>
Co-authored-by: Ana Costa <anacosta.xl@gmail.com>
  • Loading branch information
3 people committed Aug 27, 2022
1 parent ba0dc62 commit 695a4e1
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 15 deletions.
9 changes: 9 additions & 0 deletions docs/demo/level1/index.rst
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 1
******************

.. toctree::
:maxdepth: 3

level2/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/index.rst
@@ -0,0 +1,9 @@

******************************************
:mod:`Breadcrumb Level 2 <test_py_module>`
******************************************

.. toctree::
:maxdepth: 3

level3/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/index.rst
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 3
******************

.. toctree::
:maxdepth: 3

level4/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/level4/index.rst
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 4
******************

.. toctree::
:maxdepth: 3

level5/index.rst
9 changes: 9 additions & 0 deletions docs/demo/level1/level2/level3/level4/level5/index.rst
@@ -0,0 +1,9 @@

******************
Breadcrumb Level 5
******************

.. toctree::
:maxdepth: 3

level6/index.rst
4 changes: 4 additions & 0 deletions docs/demo/level1/level2/level3/level4/level5/level6/index.rst
@@ -0,0 +1,4 @@

******************
Breadcrumb Level 6
******************
6 changes: 6 additions & 0 deletions docs/index.rst
Expand Up @@ -82,3 +82,9 @@ Development
:hidden:

demo/long

.. toctree::
:maxdepth: 3
:caption: Breadcrumbs

demo/level1/index.rst
6 changes: 3 additions & 3 deletions sphinx_rtd_theme/breadcrumbs.html
Expand Up @@ -22,11 +22,11 @@
<div role="navigation" aria-label="{{ _('Page navigation') }}">
<ul class="wy-breadcrumbs">
{%- block breadcrumbs %}
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a></li>
{%- for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
<li class="breadcrumb-item"><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
{%- endfor %}
<li>{{ title }}</li>
<li class="breadcrumb-item active">{{ title }}</li>
{%- endblock %}
{%- block breadcrumbs_aside %}
<li class="wy-breadcrumbs-aside">
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

23 changes: 12 additions & 11 deletions src/sass/_theme_breadcrumbs.sass
@@ -1,21 +1,22 @@
.wy-breadcrumbs
+clearfix

.wy-breadcrumbs li
.wy-breadcrumbs > li
display: inline-block
padding-top: 5px
&.wy-breadcrumbs-aside
float: right
a
display: inline-block
padding: 5px
&:first-child
padding-left: 0
/* Style literals as links */
code
padding: 5px
border: none
background: none
&.literal
color: $text-color
all: inherit
color: inherit

.breadcrumb-item::before
content: "/"
color: #bbb
font-size: 13px
padding: 0 6px 0 3px

.wy-breadcrumbs-extra
margin-bottom: 0
color: $text-light
Expand Down

0 comments on commit 695a4e1

Please sign in to comment.