Skip to content

Commit 34239a6

Browse files
chore: latest post styling tweaks
1 parent 65c79c7 commit 34239a6

3 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/components/latest-post/latest-post.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default class LatestPost extends HTMLElement {
88

99
this.innerHTML = `
1010
<div class="${styles.pill}">
11-
<span class="new">${icon} New</span>
12-
<a href="${link}" title="Read our latest post">${title} &#8594</a>
11+
<span class="${styles.new}">${icon} New</span>
12+
<a class="${styles.link}" href="${link}" title="Read our latest post">${title} &#8594</a>
1313
</div>
1414
`;
1515
}

src/components/latest-post/latest-post.module.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
border: var(--radius-1) solid var(--color-gray-background);
66
box-shadow: var(--shadow-1);
77
text-align: left;
8+
}
89

9-
& .new {
10-
background-color: var(--color-green-pale);
11-
border-radius: var(--radius-4);
12-
padding: var(--size-2);
13-
margin-right: var(--size-1);
14-
}
10+
.new {
11+
background-color: var(--color-green-pale);
12+
border-radius: var(--radius-4);
13+
padding: var(--size-2);
14+
margin-right: var(--size-1);
15+
}
1516

16-
& a {
17-
line-height: var(--size-px-8);
18-
color: var(--color-black);
19-
}
17+
.link {
18+
line-height: var(--size-px-8);
19+
color: var(--color-black);
2020
}

src/components/latest-post/latest-post.stories.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ export const Primary = () => `
1212
title="We just launched v0.30.0"
1313
></app-latest-post>
1414
`;
15+
16+
export const CustomIcon = () => `
17+
<app-latest-post
18+
link="/blog/state-of-greenwood-2025/"
19+
title="Read the <em>State of Greenwood</em> 2025"
20+
icon="📚"
21+
></app-latest-post>
22+
`;

0 commit comments

Comments
 (0)