Skip to content

Commit

Permalink
Auto merge of rust-lang#1601 - p-jackson:fix-icon-alignment, r=jtgeibel
Browse files Browse the repository at this point in the history
Align crate icon with crate name in heading

The crate heading text (with name and version) are being aligned by baseline using flex, however the icon doesn't line up because it doesn't have baseline information.

Manually pushing the icon down so aligns "correctly" with the crate name.

Before 🤢 🤮
![image](https://user-images.githubusercontent.com/1500769/51534894-efa01f00-1eab-11e9-99a2-278b50209eab.png)

After 🌹 🦄
![image](https://user-images.githubusercontent.com/1500769/51534928-00e92b80-1eac-11e9-954d-18548d666c6c.png)
  • Loading branch information
bors committed Jan 24, 2019
2 parents 437657d + 073c5ac commit 41442f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/styles/crate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
@include flex-direction(column);
}
}
.crate-icon {
// Icon doesn't align nicely with text (which is being
// aligned by their baselines) so manual adjustment needed.
position: relative;
top: 4px;
}
h1 {
padding-left: 10px;
padding-right: 10px;
Expand Down
2 changes: 1 addition & 1 deletion app/templates/crate/version.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id='crates-heading' data-test-heading>
<div class="wide">
<div class='info'>
{{svg-jar "crate"}}
{{svg-jar "crate" class='crate-icon'}}
<h1 data-test-crate-name>{{ crate.name }}</h1>
<h2 data-test-crate-version>{{ currentVersion.num }}</h2>
</div>
Expand Down

0 comments on commit 41442f0

Please sign in to comment.