Skip to content

Commit 36d7eec

Browse files
authored
Merge pull request #10776 from eth3lbert/style-crate-row
Adjust styles for crate row
2 parents 15f1cd8 + 388a6cf commit 36d7eec

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

app/components/crate-row.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div local-class="crate-row" data-test-crate-row ...attributes>
22
<div local-class="description-box">
3-
<div>
3+
<div local-class="crate-spec">
44
{{#let (link "crate" @crate.id) as |l|}}
55
<a href={{l.url}} local-class="name" data-test-crate-link {{on "click" l.transitionTo}}>
66
{{@crate.name}}

app/components/crate-row.module.css

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,51 @@
2323
overflow-wrap: break-word;
2424
}
2525

26-
.version {
27-
margin-left: var(--space-2xs);
28-
}
29-
3026
.copy-button {
3127
composes: button-reset from '../styles/shared/buttons.module.css';
32-
padding: 0 var(--space-2xs);
3328
color: var(--main-color);
3429
cursor: pointer;
35-
opacity: 0;
36-
transition: var(--transition-medium);
3730

38-
.crate-row:hover & {
39-
opacity: .8;
40-
transition: var(--transition-instant);
41-
}
31+
/* Hover selector for pointer only */
32+
/* See: https://github.com/rust-lang/crates.io/issues/10772 */
33+
@media (pointer: fine) {
34+
opacity: 0;
35+
transition: var(--transition-medium);
4236

43-
.crate-row:hover &:hover, &:focus {
44-
opacity: 1;
45-
transition: var(--transition-instant);
37+
.crate-row:hover & {
38+
opacity: .8;
39+
transition: var(--transition-instant);
40+
}
41+
42+
.crate-row:hover &:hover, &:focus {
43+
opacity: 1;
44+
transition: var(--transition-instant);
45+
}
4646
}
4747

4848
svg {
49+
vertical-align: top;
4950
height: 1rem;
5051
width: 1rem;
5152
}
5253
}
5354

55+
.crate-spec {
56+
display: flex;
57+
flex-wrap: wrap;
58+
align-items: center;
59+
60+
& > * {
61+
margin-bottom: calc(var(--space-xs) / 2);
62+
}
63+
& > :not(last-child) {
64+
margin-right: var(--space-2xs);
65+
}
66+
}
67+
5468
.description {
5569
composes: small from '../styles/shared/typography.module.css';
56-
margin-top: var(--space-xs);
70+
margin-top: calc(var(--space-xs) / 2);
5771
line-height: 1.5;
5872
}
5973

0 commit comments

Comments
 (0)