Skip to content

Commit d1a2e0d

Browse files
committed
Move copy button to the left of the name
This allows the name to stay left-aligned. Also, space the "Copied!" text in a way that better adapts to high DPI displays.
1 parent 888de71 commit d1a2e0d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

app/styles/crate.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,27 @@
158158
display: inline-block;
159159

160160
button, button:active {
161-
padding: 0;
162-
width: 25px;
161+
padding: 0 .2rem;
163162
outline: 0;
164163

165164
&:hover {
166165
background: inherit;
167166
}
168167

169168
svg {
170-
width: 20px;
169+
height: 1rem;
170+
width: 1rem;
171171
}
172172

173173
.copy-notification {
174-
top: -15px;
174+
top: -1.25rem;
175175
left: 0;
176-
width: 255px;
177176
text-align: left;
177+
width: 4rem;
178+
179+
&.copy-failure {
180+
width: 15rem;
181+
}
178182
}
179183
}
180184
}
@@ -370,9 +374,9 @@
370374
}
371375

372376
&.copy-failure {
373-
bottom: -30px;
377+
bottom: -2rem;
374378
right: 0;
375-
width: 255px;
379+
width: 18rem;
376380
text-align: right;
377381
}
378382
}

app/templates/components/crate-row.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class='desc'>
22
<div class='info'>
3-
{{crate-toml-copy copyText=crateTomlText}}
43
{{#link-to 'crate' crate.id data-test-crate-link}}{{ crate.name }}{{/link-to}}
4+
{{crate-toml-copy copyText=crateTomlText}}
55
{{crate-badge crate=crate}}
66
{{#each crate.annotated_badges as |badge|}}
77
{{component badge.component_name badge=badge data-test-badge=badge.badge_type}}

0 commit comments

Comments
 (0)