Skip to content

Commit bddb5d1

Browse files
committed
fix: improve article-card light mode styles
+ fix author-card light mode + fix article-card storybook
1 parent 5773b00 commit bddb5d1

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

libs/blog/articles/feature-article/src/lib/article-details/article-details.stories.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const articleDetails: Article = {
4848
github: '',
4949
linkedin: '',
5050
twitter: '',
51-
titles: ['Software Engineer', 'GDE'],
51+
titles: ['blogger', 'gde'],
5252
},
5353
anchors: [],
5454
publishDate: new Date('2021-01-01').toISOString(),

libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<a [routerLink]="['/', article().slug] | alLocalize">
22
<article
3-
class="h-full rounded-lg bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"
4-
[style.background-image]="
5-
'url(' +
6-
(article().featuredImageUrl || 'assets/article-placeholder.webp') +
7-
')'
8-
"
3+
class="relative h-full overflow-hidden rounded-lg bg-black bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"
94
[attr.aria-labelledby]="article().slug"
105
>
11-
<div
12-
class="bg-al-background relative flex h-full flex-col justify-between opacity-85"
13-
>
6+
<img
7+
alt="Post featured image"
8+
class="absolute h-auto w-full bg-contain opacity-20"
9+
[ngSrc]="article().featuredImageUrl || 'assets/article-placeholder.webp'"
10+
[priority]="imagePriority()"
11+
width="1215"
12+
height="750"
13+
/>
14+
<div class="relative flex h-full flex-col justify-between text-[#fff]">
1415
<div
1516
class="hover:bg-al-bottom-radial-gradient absolute h-full w-full"
1617
></div>

libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DatePipe } from '@angular/common';
1+
import { DatePipe, NgOptimizedImage } from '@angular/common';
22
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
33
import { RouterLink } from '@angular/router';
44
import { FastSvgComponent } from '@push-based/ngx-fast-svg';
@@ -19,9 +19,11 @@ import { UiDifficultyComponent } from '@angular-love/blog/shared/ui-difficulty';
1919
UiDifficultyComponent,
2020
AlLocalizePipe,
2121
FastSvgComponent,
22+
NgOptimizedImage,
2223
],
2324
templateUrl: './article-compact-card.component.html',
2425
})
2526
export class ArticleCompactCardComponent {
2627
readonly article = input.required<ArticleCard>();
28+
readonly imagePriority = input<number | null>(null);
2729
}

libs/blog/articles/ui-article-card/src/lib/components/article-horizontal-card/article-horizontal-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<a [routerLink]="['/', article().slug] | alLocalize">
22
<article
3-
class="group relative flex h-full w-full flex-row rounded-lg shadow-none"
3+
class="light:border group relative flex h-full w-full flex-row rounded-lg shadow-none"
44
[attr.aria-labelledby]="article().slug"
55
>
66
<img

libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<a [routerLink]="['/', article().slug] | alLocalize">
22
<article
3-
class="bg-al-card md:hover:shadow-al-primary group relative h-full w-full rounded-lg border border-transparent shadow-none transition-transform motion-reduce:transition-none lg:hover:scale-105 lg:motion-reduce:hover:scale-100"
3+
class="bg-al-card md:hover:shadow-al-primary group relative h-full w-full rounded-lg border shadow-none transition-transform motion-reduce:transition-none lg:hover:scale-105 lg:motion-reduce:hover:scale-100 dark:border-transparent"
44
[attr.aria-labelledby]="article().slug"
55
>
66
<div

libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/>
1313
}
1414
@case ('compact') {
15-
<al-article-compact-card [article]="article()" />
15+
<al-article-compact-card
16+
[article]="article()"
17+
[imagePriority]="imagePriority()"
18+
/>
1619
}
1720
}

libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export type CardType = 'regular' | 'horizontal' | 'compact' | 'hero';
2222
host: {
2323
'data-testid': 'article-card',
2424
'[attr.id]': 'article().slug',
25-
class: 'light:border light:rounded-lg',
2625
},
2726
})
2827
export class UiArticleCardComponent {

libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
class="@3xl:flex-row @3xl:border-none flex w-full flex-col items-center rounded-lg border"
2121
>
2222
<div
23-
class="@3xl:border dark:@3xl:!bg-al-radial-gradient dark:@3xl:bg-al-background light:bg-[#f2f2f2] @3xl:min-w-[260px] min-w-fit rounded-lg pb-4 pt-6"
23+
class="@3xl:border dark:@3xl:!bg-al-radial-gradient dark:@3xl:bg-al-background light:@3xl:bg-[#f2f2f2] @3xl:min-w-[260px] min-w-fit rounded-lg pb-4 pt-6"
2424
>
2525
<div
2626
class="@3xl:max-w-[360px] flex w-full flex-col items-center gap-4"

0 commit comments

Comments
 (0)