Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune version and language selector styles #1603

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@

{%- if READTHEDOCS %}
{%- if theme_version_selector or theme_language_selector %}
<div class="switch-menus">
<div class="version-switch"></div>
<div class="language-switch"></div>
</div>
<div class="switch-menus">
<div class="version-switch"></div>
<div class="language-switch"></div>
</div>
{%- endif %}
{%- endif %}

Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions src/sass/_theme_layout.sass
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,15 @@ html
font-weight: normal
color: rgba(255, 255,255, 0.3)
> div.version-switch, > div.language-switch
display: inline-block
padding: .2em
select
// Provide room for dropdown icon
display: inline-block
min-width: 10em
max-width: 10em
padding: .1em 1.5em .1em .5em
margin-right: -2rem
padding-right: 2rem
max-width: $nav-desktop-width * .8
// Alter base select styles
text-align-last: center
background: none
border: none
Expand All @@ -254,24 +257,24 @@ html
font-size: 1em
font-weight: normal
color: rgba(255, 255, 255, .3)
cursor: pointer
// Allow for padding
appearance: none
-webkit-appearance: none
-moz-appearance: none
&:hover, &:active, &:focus
background: rgba(255, 255, 255, .1)
color: rgba(255, 255, 255, .5)
&:after
&:has(> select):after
display: inline-block
width: 1.5em
height: 100%
padding: .1em
content: "\f0d7"
font-size: 1em
line-height: 1.2em
font-family: FontAwesome
text-align: center
width: 1.5em
height: 100%
padding: .1em
position: absolute
right: 3.5em
pointer-events: none
box-sizing: border-box

Expand Down