Skip to content

Commit ee3a9d5

Browse files
feat(frontend): mention component
1 parent 68a4e2f commit ee3a9d5

File tree

7 files changed

+41
-0
lines changed

7 files changed

+41
-0
lines changed

helpers/frontend/views/frontend-components.njk

+20
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,26 @@
336336
src: "/assets/icon.svg"
337337
}) }}
338338

339+
<h2><code>mention</code></h2>
340+
341+
{{ mention({
342+
user: {
343+
avatar: {},
344+
name: "Joe Bloggs",
345+
url: "#",
346+
meta: "bookmarked https://getindiekit.com" | safe | urlize
347+
},
348+
mention: {
349+
title: "Indiekit",
350+
icon: "bookmark",
351+
description: {
352+
text: "Meet the little Node.js server with all the parts needed to publish content to your personal website and share it on social networks."
353+
},
354+
permalink: "#",
355+
published: "2024-12-24T18:15"
356+
}
357+
}) }}
358+
339359
<h2><code>navigation</code></h2>
340360

341361
{{ navigation({
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% macro mention(opts) %}
2+
{%- include "./template.njk" -%}
3+
{% endmacro %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.mention {
2+
display: grid;
3+
gap: var(--space-s);
4+
max-inline-size: var(--line-measure);
5+
6+
+ .mention {
7+
margin-block-start: var(--space-2xl);
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% from "../card/macro.njk" import card with context %}
2+
{% from "../user/macro.njk" import user with context %}
3+
<div class="{{ classes("mention", opts) }}">
4+
{{ user(opts.user) }}
5+
{{ card(opts.mention) }}
6+
</div>

packages/frontend/layouts/default.njk

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
{% from "heading/macro.njk" import heading with context %}
1818
{% from "hint/macro.njk" import hint with context %}
1919
{% from "input/macro.njk" import input with context %}
20+
{% from "mention/macro.njk" import mention with context %}
2021
{% from "notification-banner/macro.njk" import notificationBanner with context %}
2122
{% from "pagination/macro.njk" import pagination with context %}
2223
{% from "prose/macro.njk" import prose with context %}

packages/frontend/styles/app.css

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
@import url("../components/label/styles.css");
4545
@import url("../components/logo/styles.css");
4646
@import url("../components/main/styles.css");
47+
@import url("../components/mention/styles.css");
4748
@import url("../components/navigation/styles.css");
4849
@import url("../components/notification-banner/styles.css");
4950
@import url("../components/pagination/styles.css");

packages/frontend/styles/config/custom-properties.css

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ html {
140140
--space-m: clamp(0.75rem, 0.625rem + 0.625vw, 1rem); /* 12 → 16 */
141141
--space-l: clamp(1rem, 0.75rem + 1.25vw, 1.5rem); /* 16 → 24 */
142142
--space-xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem); /* 24 → 32 */
143+
--space-2xl: clamp(2rem, 1.5rem + 2vw, 4rem); /* 32 → 64 */
143144

144145
/* Layout */
145146
--container-padding-inline: var(--space-l);

0 commit comments

Comments
 (0)