Skip to content

Commit 8a8b65f

Browse files
authored
Merge pull request #4 from boostorg/v3
V3
2 parents b0456b2 + fc1f8a9 commit 8a8b65f

13 files changed

Lines changed: 280 additions & 22 deletions

core/views.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,9 @@ def get_context_data(self, **kwargs):
11331133
{"value": "networking", "label": "Networking"},
11341134
]
11351135
)
1136+
context["create_account_card_preview_url"] = (
1137+
f"{settings.STATIC_URL}img/checker.png"
1138+
)
11361139
context["basic_card_data"] = {
11371140
"title": "Found a Bug?",
11381141
"text": "We rely on developers like you to keep Boost solid. Here's how to report issues that help the whole comm",
@@ -1215,6 +1218,19 @@ def get_context_data(self, **kwargs):
12151218
},
12161219
]
12171220

1221+
context["learn_card_data"] = {
1222+
"title": "I want to learn:",
1223+
"text": "How to install Boost, use its libraries, build projects, and get help when you need it.",
1224+
"links": [
1225+
{"label": "Explore common use cases", "url": "https://www.example.com"},
1226+
{"label": "Build with CMake", "url": "https://www.example.com"},
1227+
{"label": "Visit the FAQ", "url": "https://www.example.com"},
1228+
],
1229+
"url": "https://www.example.com",
1230+
"label": "Learn more about Boost",
1231+
"image_src": "/static/img/v3/examples/Learn Card Image.png",
1232+
}
1233+
12181234
context["testimonial_data"] = {
12191235
"heading": "What Engineers are saying",
12201236
"testimonials": [

static/css/v3/components.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
@import './category-tags.css';
1919
@import './code-block.css';
2020
@import './search-card.css';
21+
@import './create-account-card.css';
2122
@import './privacy-policy.css';
2223
@import './library-intro-card.css';
24+
@import './learn-cards.css';
2325
@import './terms-of-use.css';
2426
@import './thread-archive-card.css';
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
.create-account-card {
2+
box-sizing: border-box;
3+
max-width: 459px;
4+
padding: var(--space-large, 16px) 0;
5+
}
6+
7+
.create-account-card__body {
8+
display: flex;
9+
flex-direction: column;
10+
gap: var(--space-large, 16px);
11+
padding: 0 var(--space-large, 16px);
12+
}
13+
14+
.create-account-card__richtext {
15+
display: flex;
16+
flex-direction: column;
17+
gap: var(--space-default, 8px);
18+
color: var(--color-text-secondary, #585a64);
19+
}
20+
21+
.create-account-card__richtext p {
22+
margin: 0;
23+
padding: 0;
24+
font-size: var(--font-size-base, 16px);
25+
font-weight: var(--font-weight-regular, 400);
26+
line-height: var(--line-height-default, 1.2);
27+
letter-spacing: -0.01em;
28+
}
29+
30+
.create-account-card__richtext ul {
31+
margin: 0;
32+
padding-left: 1.2em;
33+
list-style: disc;
34+
list-style-position: outside;
35+
}
36+
37+
.create-account-card__richtext li {
38+
font-size: var(--font-size-base, 16px);
39+
font-weight: var(--font-weight-regular, 400);
40+
line-height: var(--line-height-default, 1.2);
41+
letter-spacing: -0.01em;
42+
}
43+
44+
.create-account-card__richtext li + li {
45+
margin-top: var(--space-default, 8px);
46+
}
47+
48+
.create-account-card__preview {
49+
width: 100%;
50+
display: block;
51+
border-radius: var(--border-radius-l, 8px);
52+
}

static/css/v3/learn-cards.css

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
.learn-card {
2+
max-width: 696px;
3+
}
4+
5+
.learn-card__row {
6+
display: flex;
7+
align-items: flex-start;
8+
gap: var(--space-large, 16px);
9+
align-self: stretch;
10+
flex-direction: row;
11+
}
12+
13+
@media (max-width: 768px) {
14+
.learn-card__row {
15+
flex-direction: column;
16+
}
17+
}
18+
19+
.learn-card__column {
20+
display: flex;
21+
flex-direction: column;
22+
justify-content: space-between;
23+
align-items: flex-start;
24+
flex: 1 0 0;
25+
align-self: stretch;
26+
}
27+
28+
.learn-card__title {
29+
color: var(--color-text-primary, #050816);
30+
31+
/* Display/Desktop/Medium/Large */
32+
font-family: var(--font-display, "Mona Sans Display SemiCondensed");
33+
font-size: var(--font-size-large, 24px);
34+
font-weight: var(--font-weight-medium);
35+
line-height: var(--tight);
36+
/* 24px */
37+
letter-spacing: -0.24px;
38+
}
39+
40+
.learn-card__text {
41+
color: var(--color-text-secondary, #585A64);
42+
43+
/* Sans/Desktop/Regular/Base */
44+
font-family: var(--font-sans, "Mona Sans VF");
45+
font-size: var(--font-size-base, 16px);
46+
font-weight: var(--font-weight-regular);
47+
line-height: var(--line-height-default);
48+
/* 19.2px */
49+
letter-spacing: -0.16px;
50+
}
51+
52+
.learn-card__link-container {
53+
display: flex;
54+
min-width: 128px;
55+
align-items: center;
56+
gap: var(--space-s, 4px);
57+
}
58+
59+
.learn-card__link-icon {
60+
fill: var(--color-icon-primary)
61+
}
62+
63+
.learn-card__link {
64+
font-size: var(--font-sizes-small, 14px);
65+
font-weight: var(--font-weight-medium);
66+
line-height: 124%;
67+
/* 17.36px */
68+
letter-spacing: -0.14px;
69+
text-decoration-line: underline;
70+
text-decoration-style: solid;
71+
text-decoration-skip-ink: auto;
72+
text-decoration-thickness: 7.5%;
73+
/* 1.05px */
74+
text-underline-offset: 15.2%;
75+
/* 2.128px */
76+
text-underline-position: from-font;
77+
}
78+
79+
.learn-card__image {
80+
flex: 1 0 0;
81+
aspect-ratio: 1/1;
82+
border-radius: var(--border-radius-default, 8px);
83+
background: url(<path-to-image>) lightgray 50% / cover no-repeat, url(<path-to-image>) lightgray 50% / cover no-repeat;
84+
}

static/css/v3/terms-of-use.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565

6666
.terms-page__body p {
6767
margin: 0 0 0.5em 0;
68+
padding: 0;
6869
}
6970

7071
.terms-page__body p:last-child {

static/css/v3/v3-examples-section.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
margin-bottom: 0;
2121
}
2222

23-
.v3-examples-section__block h3 {
23+
.v3-examples-section__block .block-title {
2424
font-size: var(--font-size-base, 16px);
2525
font-weight: var(--font-weight-medium, 500);
2626
margin-bottom: var(--space-default, 8px);
180 KB
Loading

templates/v3/examples/_v3_example_section.html

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<h2 id="v3-examples-heading" class="v3-examples-section__heading">V3 Examples for testing</h2>
44

55
<div class="v3-examples-section__block">
6-
<h3>Buttons</h3>
6+
<h3 class="block-title">Buttons</h3>
77
<div class="v3-examples-section__example-box">
88
{% include "v3/examples/_v3_example_buttons_block.html" %}
99
</div>
1010
</div>
1111

1212
<div class="v3-examples-section__block">
13-
<h3>Tooltip button</h3>
13+
<h3 class="block-title">Tooltip button</h3>
1414
<div class="v3-examples-section__example-box">
1515
<div class="v3-examples-section__tools">
1616
{% include "v3/includes/_button_tooltip_v3.html" with label="Top" position="top" button_text="Help" %}
@@ -28,7 +28,7 @@ <h3>Tooltip button</h3>
2828
</div>
2929

3030
<div class="v3-examples-section__block">
31-
<h3>Avatar</h3>
31+
<h3 class="block-title">Avatar</h3>
3232
<div class="v3-examples-section__example-box">
3333
<table class="v3-examples-section__avatar-table">
3434
<tbody>
@@ -115,13 +115,13 @@ <h3>Avatar</h3>
115115

116116

117117
<div class="v3-examples-section__block v3-examples-section__block--carousel">
118-
<h3>Carousel buttons</h3>
118+
<h3 class="block-title">Carousel buttons</h3>
119119
<div class="v3-examples-section__example-box">
120120
{% include "v3/includes/_carousel_buttons.html" %}
121121
</div>
122122
</div>
123123

124-
{% comment %} <div class="v3-examples-section__block">
124+
<div class="v3-examples-section__block">
125125
<h3>Detail card carousel</h3>
126126
<div class="v3-examples-section__example-box">
127127
{% include "v3/includes/_cards_carousel_v3.html" with carousel_id="post-cards-carousel-demo" heading="Libraries categories" cards=demo_cards_carousel_cards %}
@@ -140,10 +140,10 @@ <h3>Detail card carousel with infinite looping and autoplay</h3>
140140
<div class="v3-examples-section__example-box">
141141
{% include "v3/includes/_cards_carousel_v3.html" with carousel_id="post-cards-carousel-demo-infinite-autoplay" heading="Libraries categories" cards=demo_cards_carousel_cards infinite=True autoplay=True autoplay_delay=5000 %}
142142
</div>
143-
</div> {% endcomment %}
143+
</div>
144144

145145
<div class="v3-examples-section__block">
146-
<h3>Post cards list</h3>
146+
<h3 class="block-title">Post cards list</h3>
147147
<div class="v3-examples-section__example-box">
148148
<section class="post-cards post-cards--default post-cards--neutral post-cards--vertical">
149149
<h2 class="post-cards__heading">
@@ -183,7 +183,7 @@ <h3>Detail card (single)</h3>
183183
</div>
184184

185185
<div class="v3-examples-section__block">
186-
<h3>Search Card</h3>
186+
<h3 class="block-title">Search Card</h3>
187187
<div class="v3-examples-section__example-box">
188188
{% include "v3/includes/_search_card.html" with heading="What are you trying to find?" action_url="#" popular_terms=popular_terms %}
189189
</div>
@@ -239,7 +239,14 @@ <h3>Commits per release (by library)</h3>
239239
{% endif %}
240240

241241
<div class="v3-examples-section__block">
242-
<h3>Form inputs</h3>
242+
<h3 class="block-title">Create Account Card</h3>
243+
<div class="v3-examples-section__example-box">
244+
{% 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" %}
245+
</div>
246+
</div>
247+
248+
<div class="v3-examples-section__block">
249+
<h3 class="block-title">Form inputs</h3>
243250
<div class="v3-examples-section__example-box">
244251
<div class="v3-examples-section__forms">
245252
{% include "v3/includes/_field_text.html" with name="ex_basic" label="Text field" placeholder="Enter text..." %}
@@ -265,6 +272,15 @@ <h4 class="py-large">Card with one button</h4>
265272
{% endwith %}
266273
</div>
267274

275+
<div class="v3-examples-section__block">
276+
<h3>Learn Card</h3>
277+
<div class="v3-examples-section__example-box">
278+
{% with learn_card_data as data %}
279+
{% include "v3/includes/_learn_card.html" with title=data.title text=data.text links=data.links image_src=data.image_src url=data.url label=data.label %}
280+
{% endwith %}
281+
</div>
282+
</div>
283+
268284
<div class="v3-examples-section__block">
269285
<h3>Testimonial Card</h3>
270286
<div class="v3-examples-section__example-box">
@@ -281,7 +297,7 @@ <h3>Thread Archive Card</h3>
281297
{% endwith %}
282298
</div>
283299
<div class="v3-examples-section__block">
284-
<h3>Why Boost</h3>
300+
<h3 class="block-title">Why Boost</h3>
285301
<div class="v3-examples-section__example-box">
286302
{% comment %}Use 8 cards to test ACs: "Why Boost Cards render correctly with 1–8 cards" and "Cards wrap correctly after four items on desktop/tablet" (4+4 rows).{% endcomment %}
287303
<section class="why-boost-cards" aria-labelledby="why-boost-heading">
@@ -304,21 +320,21 @@ <h2 id="why-boost-heading" class="why-boost-cards__heading">Why Boost?</h2>
304320
</div>
305321

306322
<div class="v3-examples-section__block">
307-
<h3>Category tags</h3>
323+
<h3 class="block-title">Category tags</h3>
308324
<div class="v3-examples-section__example-box">
309325
{% include "v3/includes/_category_cards.html" with show_version_tags=True %}
310326
</div>
311327
</div>
312328

313329
<div class="v3-examples-section__block">
314-
<h3>Event cards</h3>
330+
<h3 class="block-title">Event cards</h3>
315331
<div class="v3-examples-section__example-box">
316332
{% include "v3/includes/_event_cards.html" %}
317333
</div>
318334
</div>
319335

320336
<div class="v3-examples-section__block">
321-
<h3>Content event list – clickable cards (link wraps each card)</h3>
337+
<h3 class="block-title">Content event list – clickable cards (link wraps each card)</h3>
322338
<div class="v3-examples-section__example-box">
323339
<section class="post-cards post-cards--content post-cards--neutral post-cards--content-list" aria-labelledby="content-event-releases-links-list">
324340
<h2 id="content-event-releases-links-list" class="post-cards__heading"><a href="#" class="post-cards__heading-link">Releases</a></h2>
@@ -348,7 +364,7 @@ <h2 id="content-event-releases-links-card" class="post-cards__heading"><a href="
348364
</div>
349365

350366
<div class="v3-examples-section__block">
351-
<h3>Content detail card</h3>
367+
<h3 class="block-title">Content detail card</h3>
352368
<div class="v3-examples-section__example-box">
353369
<section class="content-story-section">
354370
<h4 class="content-story-section__title">Content detail card</h4>
@@ -368,7 +384,7 @@ <h4 class="content-story-section__title">Content detail card</h4>
368384
</div>
369385

370386
<div class="v3-examples-section__block">
371-
<h3>Code blocks</h3>
387+
<h3 class="block-title">Code blocks</h3>
372388
<div class="v3-examples-section__example-box">
373389
{% include "v3/includes/_code_blocks_story.html" with code_standalone_1=code_demo_beast code_standalone_2=code_demo_beast code_card_1=code_demo_hello code_card_2=code_demo_beast code_card_3=code_demo_install %}
374390
</div>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{% comment %}
22
V3 foundation button: hero primary (larger, for hero section). Optional leading icon.
3-
Variables: label (required), url (optional), icon_html (optional; HTML for icon, use with |safe), type (optional).
3+
Variables: label (required), url (optional), icon_html (optional; HTML for icon, use with |safe), type (optional), extra_classes (optional).
44
Icon must be wrapped in <span class="btn-icon" aria-hidden>...</span>.
55
Usage: {% include "v3/includes/_button_hero_primary.html" with label="Get started" icon_html='<span class="btn-icon" aria-hidden><i class="fas fa-arrow-right"></i></span>' %}
66
{% endcomment %}
77
{% if url %}
8-
<a href="{{ url }}" class="btn btn-hero btn-primary">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</a>
8+
<a href="{{ url }}" class="btn btn-hero btn-primary {{extra_classes}}">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</a>
99
{% else %}
10-
<button type="{{ type|default:'button' }}" class="btn btn-hero btn-primary">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</button>
10+
<button type="{{ type|default:'button' }}" class="btn btn-hero btn-primary {{extra_classes}}">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</button>
1111
{% endif %}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{% comment %}
22
V3 foundation button: hero secondary.
3-
Variables: label (required), url (optional), icon_html (optional), type (optional).
3+
Variables: label (required), url (optional), icon_html (optional), type (optional), extra_classes (optional).
44
Usage: {% include "v3/includes/_button_hero_secondary.html" with label="Learn more" %}
55
{% endcomment %}
66
{% if url %}
7-
<a href="{{ url }}" class="btn btn-hero btn-secondary">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</a>
7+
<a href="{{ url }}" class="btn btn-hero btn-secondary {{extra_classes}}">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</a>
88
{% else %}
9-
<button type="{{ type|default:'button' }}" class="btn btn-hero btn-secondary">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</button>
9+
<button type="{{ type|default:'button' }}" class="btn btn-hero btn-secondary {{extra_classes}}">{% if icon_html %}{{ icon_html|safe }}{% endif %}{{ label }}</button>
1010
{% endif %}

0 commit comments

Comments
 (0)