Skip to content

Commit

Permalink
[PYT-220] Update left side menu (Lightning-AI#45)
Browse files Browse the repository at this point in the history
- Padding on left/right sides should be equal
- Increase space between lists in left nav
- New styles for search box
- Search prompt should be either 'Docs' or 'Tutorials'
  • Loading branch information
brsoff authored Sep 9, 2018
1 parent 2d858b1 commit 60eb4b3
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 15 deletions.
9 changes: 8 additions & 1 deletion pytorch_sphinx_theme/searchbox.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{%- if builder != 'singlehtml' %}

{% if theme_pytorch_project == 'tutorials' %}
{% set search_project = 'Tutorials' %}
{% else %}
{% set search_project = 'Docs' %}
{% endif %}

<div role="search">
<form id="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="{{ _('Search docs') }}" />
<input type="text" name="q" placeholder="Search {{ search_project }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
Expand Down
31 changes: 24 additions & 7 deletions pytorch_sphinx_theme/static/css/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scss/_sphinx_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $sphinx_full_width: 1600px;
$sphinx_medium_width: 1101px;
$sphinx_full_width_content_width: 700px;

$sphinx_left_menu_wrapper_padding_right: 15%;
$sphinx_left_menu_wrapper_padding_right: 13.5%;
$sphinx_left_menu_width: 25%;
$sphinx_left_menu_scroll_wrapper_width: 120%;

Expand Down
39 changes: 33 additions & 6 deletions scss/_sphinx_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}

@include sphinx-full-size {
padding-right: rem(30px);
padding-right: rem(65px);
}
}

Expand Down Expand Up @@ -127,13 +127,12 @@
padding: 0 rem(30px) 0 0;
position: fixed;
top: 90px;
min-width: 280px;
width: $sphinx_left_menu_width;
z-index: 200;
}

@include sphinx-full-size {
padding: 0 rem(60px) 0 rem(30px);
padding: 0 0 0 rem(30px);
width: $desktop_menu_width;
}
}
Expand Down Expand Up @@ -171,18 +170,46 @@
}

@include sphinx-full-size {
margin: rem(40px) 0 rem(60px) 0;
margin: rem(40px) 0;
}
}

.pytorch-left-menu-search {
::-webkit-input-placeholder {
color: $not_quite_black;
}

::-moz-placeholder {
color: $not_quite_black;
}

:-ms-input-placeholder {
color: $not_quite_black;
}

:-moz-placeholder {
color: $not_quite_black;
}

::placeholder {
color: $not_quite_black;
}
}

.pytorch-left-menu-search input[type=text] {
border-radius: 0;
padding: rem(8px) rem(12px);
border-color: $orange;
color: $orange;
color: $not_quite_black;
border-style: solid;
font-size: rem(16px);
width: 100%;
background-color: $light_grey;
text-align: center;

&:focus {
outline: 0;
}
}

.pytorch-left-menu .pytorch-side-scroll {
Expand Down Expand Up @@ -228,7 +255,7 @@
ul {
list-style-type: none;
padding-left: 0;
margin-bottom: rem(20px);
margin-bottom: rem(40px);
}

> ul {
Expand Down

0 comments on commit 60eb4b3

Please sign in to comment.