Skip to content

Commit 64c6b2f

Browse files
committed
refactor: simplify the cards used on community page
1 parent 1f7bf86 commit 64c6b2f

8 files changed

Lines changed: 33 additions & 44 deletions

File tree

static/css/v3/components.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
@import "./library-intro-card.css";
2727
@import "./learn-cards.css";
2828
@import "./terms-of-use.css";
29-
@import "./thread-archive-card.css";
3029
@import "./tab.css";
3130
@import "./install-card.css";
3231
@import "./banner.css";
@@ -52,4 +51,4 @@
5251
@import "release-highlights-card.css";
5352
@import "./media-text-card.css";
5453
@import "./library-discovery-card.css";
55-
@import "./help-cards.css";
54+
@import "./help-card.css";
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Help cards: section wrapper with a grid of speech-bubble user cards.
3-
* Rendered by templates/v3/includes/_help_cards.html.
2+
* Help card: section wrapper with a grid of speech-bubble user cards.
3+
* Rendered by templates/v3/includes/_help_card.html.
44
*/
55

66
/* ── Section wrapper ───────────────────────────────────────── */
77

8-
.community-help {
8+
.help-card-section {
99
--chat-bubble-tail-padding: 60px;
1010

1111
display: flex;
@@ -17,7 +17,7 @@
1717
border-radius: var(--border-radius-xl);
1818
}
1919

20-
.community-help__heading {
20+
.help-card-section__heading {
2121
font-family: var(--font-display);
2222
font-size: var(--font-size-large);
2323
font-weight: var(--font-weight-medium);
@@ -29,7 +29,7 @@
2929
line-height: var(--line-height-tight);
3030
}
3131

32-
.community-help__grid {
32+
.help-card-section__grid {
3333
display: grid;
3434
gap: var(--space-large);
3535
padding: var(--space-large);
@@ -102,12 +102,12 @@
102102
/* ── Responsive ────────────────────────────────────────────── */
103103

104104
@media (max-width: 767px) {
105-
.community-help {
105+
.help-card-section {
106106
--chat-bubble-tail-padding: 48px;
107107
max-width: 458px;
108108
}
109109

110-
.community-help__grid {
110+
.help-card-section__grid {
111111
grid-template-columns: 1fr;
112112
grid-template-rows: none;
113113
row-gap: calc(var(--space-large) * 2);

static/css/v3/thread-archive-card.css

Lines changed: 0 additions & 8 deletions
This file was deleted.

templates/v3/community.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212
{% include "v3/includes/_hero_library.html" with title="A community built to help you go further" description="For newcomers and experienced engineers alike, Boost is a place to build real libraries, learn from experts and make contributions that matter." hero_image_url="/static/img/v3/Community-page/community-foreground.png" %}
1313
<div class="community-container">
1414
<div class="community-masonry">
15-
{# Help spans full row at every breakpoint (see community.css) #}
16-
{% include "v3/includes/_help_cards.html" with heading="What do you need help with?" items=help_options extra_classes="community-masonry__help" %}
17-
{# Cols are real boxes at desktop; at tablet/mobile they use display:contents so cells become direct grid children and can be reshuffled via grid-template-areas. #}
15+
{% include "v3/includes/_help_card.html" with heading="What do you need help with?" items=help_options extra_classes="community-masonry__help" %}
1816
<div class="community-masonry__col">
1917
<div class="community-masonry__cell community-masonry__cell--install">
2018
{% include "v3/includes/_install_card.html" with card_id="community-install" install_card_pkg_managers=install_card_pkg_managers install_card_system_install=install_card_system_install %}
2119
</div>
2220
<div class="community-masonry__cell community-masonry__cell--slack">
23-
{% with member_count=slack_member_count|default:"30,000" %}
24-
{% include "v3/includes/_vertical_card.html" with title="Join the discussion on Slack" image_url="/static/img/v3/Community-page/community-slack-preview.png" primary_button_url="https://cppalliance.org/slack/" primary_button_label="Chat with "|add:member_count|add:" members" only %}
25-
{% endwith %}
21+
{% include "v3/includes/_join_slack_card.html" %}
2622
</div>
2723
<div class="community-masonry__cell community-masonry__cell--contribute">
2824
{% include "v3/includes/_create_account_card.html" with heading="Contribute to earn badges, track your progress and grow your impact" body_html=create_account_card_body_html preview_image_url=create_account_card_preview_url cta_url="#" cta_label="Start contributing" %}
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@
1414
aria_label (string, optional) — defaults to heading.
1515

1616
Usage:
17-
{% include "v3/includes/_help_cards.html" with heading="What do you need help with?" items=help_options extra_classes="community-masonry__help" %}
17+
{% include "v3/includes/_help_card.html" with heading="What do you need help with?" items=help_options extra_classes="community-masonry__help" %}
1818
{% endcomment %}
19-
<section class="community-help{% if extra_classes %} {{ extra_classes }}{% endif %}"
19+
<section class="help-card-section {% if extra_classes %}{{ extra_classes }}{% endif %}"
2020
aria-label="{{ aria_label|default:heading }}">
21-
<h2 class="community-help__heading">{{ heading }}</h2>
22-
<hr class="card__hr" aria-hidden="true"/>
23-
<div class="community-help__grid">
21+
<h2 class="help-card-section__heading">{{ heading }}</h2>
22+
<hr class="card__hr" aria-hidden="true" />
23+
<div class="help-card-section__grid">
2424
{% for option in items %}
2525
<article class="help-card">
2626
<div class="help-card__bubble-wrap">
2727
<div class="help-card__bubble">
2828
<p class="help-card__quote">“{{ option.quote }}”</p>
2929
</div>
3030
<div class="help-card__tail-wrapper">
31-
<svg width="32" height="30" viewBox="0 0 32 30" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
31+
<svg width="32"
32+
height="30"
33+
viewBox="0 0 32 30"
34+
fill="none"
35+
xmlns="http://www.w3.org/2000/svg"
36+
aria-hidden="true">
3237
<path class="help-card__tail" d="M0 0H32L3.41421 28.5858C2.15428 29.8457 0 28.9534 0 27.1716V0Z" />
3338
</svg>
3439
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% comment %}
2+
Join Slack card. Invites readers to join the Boost Slack workspace.
3+
4+
Variables (read from context):
5+
slack_member_count (string, optional) — member count shown in the CTA. Defaults to "30,000".
6+
{% endcomment %}
7+
{% with member_count=slack_member_count|default:"30,000" %}
8+
{% include "v3/includes/_vertical_card.html" with title="Join the discussion on Slack" image_url="/static/img/v3/community-page/community-slack-preview.png" image_alt="Preview of the Boost Slack workspace" primary_button_url="https://cppalliance.org/slack/" primary_button_label="Chat with "|add:member_count|add:" members" only %}
9+
{% endwith %}

templates/v3/includes/_thread_archive_card.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,4 @@
22
Thread archive card. Links to the latest mailing list threads, as well as the archive.
33
{% endcomment %}
44
{% load static %}
5-
<div class="basic-card thread-archive-card card">
6-
<div class="card__header">
7-
<span class="card__title">Explore The Boost Developers Mailing List</span>
8-
</div>
9-
<hr class="card__hr" />
10-
<div class="card__column px-large">
11-
<img src="{% static 'img/v3/community-page/community-mailing-list-preview.png' %}" alt="">
12-
</div>
13-
<hr class="card__hr" />
14-
<div class="card__cta_section">
15-
{% include "v3/includes/_button.html" with style="primary" url="https://lists.boost.org/archives/list/boost@lists.boost.org/latest" label="Recent Threads" only %}
16-
{% include "v3/includes/_button.html" with style="secondary" url="https://lists.boost.org/archives/list/boost@lists.boost.org/" label="View Archive" only %}
17-
</div>
18-
</div>
5+
{% include "v3/includes/_vertical_card.html" with title="Explore The Boost Developers Mailing List" image_url="/static/img/v3/community-page/community-mailing-list-preview.png" image_alt="Preview of recent threads on the Boost developers mailing list" primary_button_url="https://lists.boost.org/archives/list/boost@lists.boost.org/latest" primary_button_label="Recent Threads" secondary_button_url="https://lists.boost.org/archives/list/boost@lists.boost.org/" secondary_button_label="View Archive" only %}

templates/v3/includes/_vertical_card.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Title: Required, text that appears bolded at the top of the card
55
Text: optional, text that appears in the middle of the card
66
image_url: optional, url of an image that should appear in the card
7+
image_alt: optional, alt text for the image (defaults to "" — image treated as decorative)
78
Primary Button Url, Label, and Style: Optional. Url is the destination of the button, label is the text of the button, style is from the style list
89
Secondary Button Url, Label, and Style: Optional, same use as primary
910
{% endcomment %}
@@ -14,7 +15,7 @@
1415
<hr class="card__hr" />
1516
<div class="card__column px-large">
1617
{% if text %}<span>{{ text }}</span>{% endif %}
17-
{% if image_url %}<img class="card__image" src="{{ image_url }}" />{% endif %}
18+
{% if image_url %}<img class="card__image" src="{{ image_url }}" alt="{{ image_alt|default:'' }}">{% endif %}
1819
</div>
1920
<hr class="card__hr" />
2021
<div class="card__cta_section">

0 commit comments

Comments
 (0)