Skip to content

Commit 8457594

Browse files
authored
feat: style broken imgs (#272)
1 parent cb2d183 commit 8457594

File tree

7 files changed

+26
-1
lines changed

7 files changed

+26
-1
lines changed

src/lib/components/dashboard/notifications/NotificationDescription.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
}
123123
124124
.image {
125+
@include mixins.broken-img;
126+
125127
display: inline;
126128
border-radius: 50%;
127129
vertical-align: sub;

src/lib/components/dashboard/sidebar/WatchedPersons.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@
189189
color: variables.$bg-5;
190190
}
191191
}
192+
193+
&:not(.placeholder) {
194+
@include mixins.broken-img;
195+
}
192196
}
193197
194198
.number {

src/lib/components/dashboard/sidebar/WatchedRepos.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@
280280
border-radius: variables.$small-radius;
281281
}
282282
283+
.image {
284+
@include mixins.broken-img;
285+
}
286+
283287
.repo-icon {
284288
display: flex;
285289
align-items: center;

src/lib/components/settings/Settings.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@
189189
}
190190
191191
.image {
192+
@include mixins.broken-img;
193+
192194
width: 2rem;
193195
height: 2rem;
194196
border-radius: 50%;

src/lib/components/settings/accounts/Account.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
gap: 0.5rem;
6969
7070
.image {
71+
@include mixins.broken-img;
72+
7173
width: 2rem;
7274
height: 2rem;
7375
border-radius: 50%;

src/lib/components/settings/gitlab-settings/RepoInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
errorMessage = 'Repository already submitted';
3838
return;
3939
}
40-
const regex = /^(http|https):\/\/[a-zA-Z0-9-]+\.[a-zA-Z]{2,}\/.*$/i;
40+
const regex = /^(http|https):\/\/[a-zA-Z0-9-.]+\.[a-zA-Z]{2,}\/.*$/i;
4141
if (regex.test(value)) {
4242
try {
4343
const url = new URL(value);

src/styles/_mixins.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,14 @@
160160
opacity: 1;
161161
}
162162
}
163+
164+
@mixin broken-img() {
165+
position: relative;
166+
167+
&::before {
168+
position: absolute;
169+
background: variables.$bg-4;
170+
content: '';
171+
inset: 0;
172+
}
173+
}

0 commit comments

Comments
 (0)