Skip to content

Commit fa7fdff

Browse files
committed
CrateRow: Show "Copy" button only when the row is hovered
1 parent 733752d commit fa7fdff

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/components/crate-row.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{{ @crate.name }}
1111
</LinkTo>
1212
<span local-class="version" data-test-version>v{{@crate.max_version}}</span>
13-
<CrateTomlCopy @copyText='{{@crate.name}} = "{{@crate.max_version}}"' @inline={{true}} />
13+
<CrateTomlCopy @copyText='{{@crate.name}} = "{{@crate.max_version}}"' @inline={{true}} local-class="copy-button" />
1414
</div>
1515
<div local-class="description" data-test-description>
1616
{{ truncate-text @crate.description }}

app/components/crate-row.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
margin-left: 10px;
2222
}
2323

24+
.copy-button {
25+
opacity: 0;
26+
transition: 50ms;
27+
28+
.crate-row:hover & {
29+
opacity: 1;
30+
}
31+
}
32+
2433
.description {
2534
composes: small from '../styles/shared/typography.module.css';
2635
margin-top: 8px;

0 commit comments

Comments
 (0)