Skip to content

Commit

Permalink
fix CSS for sidebar TOC.
Browse files Browse the repository at this point in the history
docs: demo has its own TOC file, in order to demonstrate breadcrumbs.
  • Loading branch information
schettino72 committed Apr 20, 2019
1 parent e1b3c23 commit 527f163
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 31 deletions.
5 changes: 1 addition & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ sphinx_press_theme
about
configuration


.. toctree::
:maxdepth: 2
:caption: Demo

theme-demo/basic
theme-demo/admonition
theme-demo/domain
theme-demo/index



Expand Down
12 changes: 12 additions & 0 deletions docs/source/theme-demo/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Demo
====

Showcase of Sphinx features using **Press** theme.

.. toctree::
:maxdepth: 2

basic
admonition
domain
extensions
28 changes: 28 additions & 0 deletions ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,34 @@
<navlinks>
xxx
</navlinks>

<div class="sidebar-links" role="navigation" aria-label="main navigation">
<div class="sidebar-group">
<p class="caption"><span class="caption-text">Docs</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">About</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="#status">Status</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
</ul>

<p class="caption"><span class="caption-text">Demo</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Demo</a>
<ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Basic Specification</a></li>
<li class="toctree-l2"><a class="reference internal" href="admonition.html">Admonitions</a></li>
<li class="toctree-l2"><a class="reference internal" href="domain.html">domain</a></li>
<li class="toctree-l2"><a class="reference internal" href="extensions.html">Extensions</a></li>
</ul>
</li>
</ul>

</div>
</div><!-- sidebar-links -->

</sidebar>

<page> <!-- :sidebar-items="sidebarItems"> -->
Expand Down
51 changes: 24 additions & 27 deletions ui/src/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,36 +168,33 @@ function resolveOpenGroupIndex (route, items) {
/**** SidebarLink.vue ***/
/*.sidebar .sidebar-sub-headers*/
.sidebar .toctree-l1 ul
padding-left 1rem
font-size 0.95em
/* extra indication of current, since no support to hight current location */
.toctree-l1.current > ul
border-left: .5rem solid lighten($accentColor, 40%)
.sidebar a.reference
font-weight 400
display inline-block
color $textColor
border-left 0.5rem solid transparent
padding 0.35rem 1rem 0.35rem 1.25rem
line-height 1.4
width: 100%
box-sizing: border-box
&:hover
color $accentColor
&.current
font-weight 600
color $accentColor
border-left-color $accentColor
.sidebar-group &
padding-left 2rem
.toctree-l2 &
padding-top 0.25rem
padding-bottom 0.25rem
border-left none
.sidebar
.toctree-l1 a, .toctree-l2 a
font-weight 400
display inline-block
color $textColor
line-height 1.4
width: 100%
box-sizing: border-box
border-left 0.5rem solid transparent
&.current
font-weight 500
color $accentColor
font-weight 600
&:hover
color $accentColor
// /* extra indication of current, since no support to hight current location */
.toctree-l1.current a
border-left: .5rem solid lighten($accentColor, 40%)
.toctree-l1 a
padding 0.35rem 1rem 0.35rem 1.25rem
&.current
border-left-color $accentColor
.toctree-l2 a
padding 0.25rem 1rem 0.25rem 1.75rem
/**** end: SidebarLink.vue ***/
Expand Down
3 changes: 3 additions & 0 deletions ui/src/sphinx-theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ ul.breadcrumbs
color darken(red, 40%)
a
color $textColor

blockquote
margin-left -0.4rem

0 comments on commit 527f163

Please sign in to comment.