Skip to content

Add styles to language selects #1709

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

Merged
merged 3 commits into from
Aug 21, 2022
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
30 changes: 30 additions & 0 deletions src/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -624,3 +624,33 @@ blockquote::before {
/* Tachyons is missing this class */
max-height: 10rem;
}

.select {
display: inline-block;
position: relative;
}

.select select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
font-size: 1.25rem;
border: $gray 1px solid;
background-color: white;
padding: 2px 6px;
color: $gray;
box-sizing: border-box;
}

.select:after {
content: "";
position: absolute;
top: 50%;
right: 8px;
width: 0;
height: 0;
margin-top: -2px;
border-top: 5px solid $gray;
border-right: 5px solid transparent;
border-left: 5px solid transparent;
}
4 changes: 3 additions & 1 deletion templates/components/footer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<li><a href="https://users.rust-lang.org">{{fluent "footer-ask"}}</a></li>
</ul>
<div class="languages">
<div class="select">
<label for="language-footer" class="hidden">{{fluent "choose-language"}}</label>
<select id="language-footer">
{{> components/languages-dropdown}}
{{> components/languages-dropdown}}
</select>
</div>
</div>
</div>
<div class="flex flex-column mw8 w-100 measure-wide-l pv2 pv5-m pv2-ns ph4-m ph4-l">
Expand Down
10 changes: 6 additions & 4 deletions templates/components/nav.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
</ul>

<div class=" w-100 w-auto-l flex-none flex justify-center pv4 pv-0-l languages">
<label for="language-nav" class="hidden">{{fluent "choose-language"}}</label>
<select id="language-nav" data-current-lang="{{lang}}">
{{> components/languages-dropdown}}
</select>
<div class="select">
<label for="language-nav" class="hidden">{{fluent "choose-language"}}</label>
<select id="language-nav" data-current-lang="{{lang}}">
{{> components/languages-dropdown}}
</select>
</div>
</div>

</nav>