Skip to content

Commit e05c62e

Browse files
committed
fix(DependenciesView): move exclude dependency button
1 parent fdb967d commit e05c62e

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

src/views/DependenciesView.vue

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
<tbody>
2929
<tr v-for="dep in dependencies.filter((dep) => !excludedDependencies.has(dep))" :key="dep">
3030
<td :title="dep" :style="{ color: composeHashColorFromString(dep) }" class="chip">
31+
<button class="icon" type="button" title="exclude dependency" @click="hideDependency(dep)">
32+
<icon-x />
33+
</button>
3134
<a :href="`https://npmjs.org/${dep}`" target="_blank" class="text-truncate">
3235
{{ dep }}
3336
<div>{{ latestVersions[dep] ?? '???' }}</div>
3437
</a>
35-
<button class="icon" type="button" title="exclude dependency" @click="hideDependency(dep)">
36-
<icon-x />
37-
</button>
3838
</td>
3939
<td v-for="repo in repos" :key="repo.id" :class="versionDiffClass(dep, repo.dependencies![dep])">
4040
{{ repo.dependencies![dep] }}
@@ -89,22 +89,6 @@ function versionDiffClass(packageName: string, version?: string): ReleaseType |
8989
}
9090
}
9191
}
92-
.chip {
93-
display: flex;
94-
gap: 0.25rem;
95-
.icon {
96-
margin-left: auto;
97-
color: var(--negative);
98-
@media (hover: hover) and (pointer: fine) {
99-
// hide icon only on non-touch devices
100-
display: none;
101-
}
102-
}
103-
&:hover .icon,
104-
&:focus-visible .icon {
105-
display: inline-block;
106-
}
107-
}
10892
&-table {
10993
width: 100%;
11094
cursor: default;
@@ -126,6 +110,21 @@ function versionDiffClass(packageName: string, version?: string): ReleaseType |
126110
td {
127111
min-width: 5rem;
128112
padding-block: 0.25rem;
113+
&.chip {
114+
display: grid;
115+
grid-template-columns: 1.5rem 10rem;
116+
gap: 0.25rem;
117+
.icon {
118+
color: var(--negative);
119+
@media (hover: hover) and (pointer: fine) { // hide icon only on non-touch devices
120+
visibility: hidden;
121+
}
122+
}
123+
&:hover .icon,
124+
&:focus-visible .icon {
125+
visibility: visible;
126+
}
127+
}
129128
&.patch {
130129
color: #79d297;
131130
background-color: #79d29726;
@@ -143,13 +142,9 @@ function versionDiffClass(packageName: string, version?: string): ReleaseType |
143142
thead th, tbody td {
144143
white-space: nowrap;
145144
&:first-of-type {
146-
max-width: 12vw;
147145
div {
148146
font-size: 0.75rem;
149147
}
150-
@media (width <= 600px) {
151-
max-width: 10rem;
152-
}
153148
}
154149
&:not(:first-of-type) {
155150
text-align: center;

0 commit comments

Comments
 (0)