Skip to content

Commit ed2a7ac

Browse files
committed
Move v3 markdown components onto boostlook
Adds the boostlook class to the v3 components that render markdown or rich text (content modal, markdown card, shared user-profile bio, post detail body, release highlights descriptions) and removes their temporary component-level markdown CSS, which now lives in boostlook's 17-site-components.css. The vendored boostlook-v3.css that carries those rules is added by the boostlook v3 integration PR (boostorg#2411); this change depends on it.
1 parent f5d611f commit ed2a7ac

9 files changed

Lines changed: 23 additions & 241 deletions

static/css/v3/content-modal.css

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -126,50 +126,9 @@
126126
outline: none;
127127
}
128128

129-
/* ============================================
130-
PROSE — rich-content styling, isolated to the modal.
131-
Self-contained so no shared `.markdown-content` rules apply.
132-
============================================ */
133-
.content-modal__prose {
134-
color: var(--color-text-secondary);
135-
font-family: var(--font-sans);
136-
font-size: var(--font-size-base);
137-
font-weight: var(--font-weight-regular);
138-
line-height: var(--line-height-default);
139-
letter-spacing: var(--letter-spacing-tight);
140-
}
141-
142-
.content-modal__prose :is(h2, h3, h4, h5, h6) {
143-
margin: var(--space-xlarge) 0 var(--space-large);
144-
color: var(--color-text-primary);
145-
font-size: var(--font-size-large);
146-
font-weight: var(--font-weight-medium);
147-
line-height: var(--line-height-tight);
148-
letter-spacing: var(--letter-spacing-display-regular);
149-
}
150-
151-
.content-modal__prose h2 {
152-
font-size: var(--font-size-large);
153-
}
154-
155-
.content-modal__prose h3 {
156-
font-size: var(--font-size-base);
157-
}
158-
159-
.content-modal__prose :is(h4, h5, h6) {
160-
font-size: var(--font-size-small);
161-
}
162-
163-
/* Sit flush with the top — no leading margin on the first prose element. */
164-
.content-modal__prose > :first-child {
165-
margin-top: 0;
166-
}
167-
168-
.content-modal__prose p {
169-
margin: var(--space-default) 0;
170-
padding: 0;
171-
line-height: var(--line-height-loose);
172-
}
129+
/* PROSE — the `.boostlook.content-modal__prose` typography now lives in
130+
Boostlook (boostlook repo: src/css/17-site-components.css), so it ships
131+
with boostlook-v3.css. Nothing to override here. #2491 */
173132

174133
/* ============================================
175134
RESPONSIVE

static/css/v3/markdown-card.css

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,4 @@
1-
.card__column.markdown-content {
2-
gap: var(--space-medium);
3-
line-height: var(--line-height-code);
4-
}
5-
6-
.markdown-content ul,
7-
.markdown-content ol {
8-
list-style: none;
9-
padding: 0;
10-
}
11-
12-
.markdown-content li {
13-
position: relative;
14-
padding-left: var(--space-xlarge);
15-
margin-top: var(--space-medium);
16-
17-
}
18-
19-
.markdown-content ul > li::before {
20-
content: "\2022";
21-
position: absolute;
22-
left: 0;
23-
top: 0;
24-
width: var(--space-xlarge);
25-
height: calc(var(--font-size-small) * 1.2);
26-
display: flex;
27-
align-items: center;
28-
justify-content: center;
29-
color: var(--color-text-primary);
30-
}
31-
32-
.markdown-content a {
33-
color: var(--color-text-link-accent);
34-
text-decoration: underline;
35-
text-decoration-skip-ink: none;
36-
text-underline-position: from-font;
37-
}
38-
39-
.markdown-content {
40-
color: var(--color-text-secondary);
41-
padding: 0 var(--space-large);
42-
font-size: var(--font-size-small);
43-
font-weight: var(--font-weight-regular);
44-
letter-spacing: var(--letter-spacing-tight);
45-
overflow-y: auto;
46-
overflow-wrap: anywhere;
47-
min-width: 0;
48-
}
49-
50-
.markdown-content pre {
51-
white-space: pre-wrap;
52-
overflow-wrap: anywhere;
53-
}
54-
55-
.markdown-content h1,
56-
.markdown-content h2,
57-
.markdown-content h3,
58-
.markdown-content h4,
59-
.markdown-content h5,
60-
.markdown-content h6 {
61-
color: var(--color-text-primary);
62-
font-family: var(--font-display);
63-
font-weight: var(--font-weight-medium);
64-
margin: 0;
65-
}
66-
67-
.markdown-content h1 { font-size: var(--font-size-large); }
68-
.markdown-content h2 { font-size: var(--font-size-medium); }
69-
.markdown-content h3 { font-size: var(--font-size-base); }
70-
.markdown-content h4,
71-
.markdown-content h5,
72-
.markdown-content h6 { font-size: var(--font-size-small); }
73-
74-
.markdown-content b,
75-
.markdown-content strong {
76-
color: var(--color-text-primary);
77-
font-weight: var(--font-weight-medium);
78-
}
79-
80-
.markdown-card p {
81-
padding: 0;
82-
margin: 0;
83-
}
84-
85-
.markdown-card ul,
86-
.markdown-card ol {
87-
list-style-position: outside;
88-
padding-left: 14px;
89-
}
90-
91-
.markdown-content :is(code, tt, pre) {
92-
display: inline;
93-
font-family: var(--font-code);
94-
font-size: 0.88em;
95-
font-weight: var(--font-weight-medium);
96-
color: var(--color-text-primary);
97-
background: transparent;
98-
padding: 0;
99-
border: none;
100-
border-radius: 0;
101-
}
1+
/* The .markdown-content styling (markdown card + user-profile bio) now lives in
2+
Boostlook (boostlook repo: src/css/17-site-components.css), scoped
3+
.boostlook.markdown-content, and ships with boostlook-v3.css. The containers
4+
carry the `boostlook` class. Nothing to override here. #2491 */

static/css/v3/post-detail.css

Lines changed: 8 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -66,111 +66,31 @@
6666
display: flex;
6767
flex-direction: column;
6868
gap: var(--space-large);
69-
font-size: var(--font-size-base);
70-
line-height: var(--line-height-loose);
71-
letter-spacing: var(--letter-spacing-tight);
72-
color: var(--color-text-secondary);
7369
padding-top: var(--space-xl);
7470
border-top: 1px solid var(--color-stroke-weak);
7571
}
7672

77-
/* Copy the body styling to markdown blocks for wagtail styling. */
73+
/* Wagtail wraps markdown blocks; keep the flex layout so block rhythm
74+
matches the body. Typography comes from Boostlook via the `boostlook`
75+
class on .post-detail__body. */
7876
.post-detail__body .block-markdown {
7977
display: flex;
8078
flex-direction: column;
8179
gap: var(--space-large);
82-
font-size: var(--font-size-base);
83-
line-height: var(--line-height-loose);
84-
letter-spacing: var(--letter-spacing-tight);
85-
color: var(--color-text-secondary);
86-
}
87-
88-
/* Reset the site-wide `p { @apply py-5 }` from frontend/styles.css
89-
so paragraph rhythm comes from the body's flex `gap`, not from
90-
each <p> contributing its own 1.25rem of top/bottom padding. */
91-
.post-detail__body p {
92-
padding-top: 0;
93-
padding-bottom: 0;
9480
}
9581

96-
.post-detail__body a {
97-
color: inherit;
98-
text-decoration: underline;
99-
}
82+
/* The article body's markdown/rich-text styling (body copy color/size,
83+
links, images, code, lists, headings, bold) now lives in Boostlook
84+
(boostlook repo: src/css/17-site-components.css), scoped
85+
.boostlook.post-detail__body, and ships with boostlook-v3.css. The
86+
container carries the `boostlook` class. #2491 */
10087

10188
.post-detail__external-url a {
10289
color: var(--color-text-secondary);
10390
text-decoration: underline;
10491
text-underline-position: from-font;
10592
}
10693

107-
.post-detail__body img {
108-
max-width: 100%;
109-
height: auto;
110-
border-radius: var(--border-radius-m);
111-
}
112-
113-
.post-detail__body pre,
114-
.post-detail__body code {
115-
font-family: var(--font-code);
116-
font-size: var(--font-size-small);
117-
}
118-
119-
.post-detail__body pre {
120-
padding: var(--space-medium);
121-
border-radius: var(--border-radius-m);
122-
background: var(--color-surface-mid);
123-
overflow-x: auto;
124-
}
125-
126-
.post-detail__body ul,
127-
.post-detail__body ol {
128-
padding-left: var(--space-large);
129-
list-style-position: outside;
130-
}
131-
132-
.post-detail__body ul {
133-
list-style-type: disc;
134-
}
135-
136-
.post-detail__body ol {
137-
list-style-type: decimal;
138-
}
139-
140-
.post-detail__body ul ul {
141-
list-style-type: circle;
142-
}
143-
144-
.post-detail__body ol ol,
145-
.post-detail__body ul ol {
146-
list-style-type: lower-alpha;
147-
}
148-
149-
.post-detail__body h1,
150-
.post-detail__body h2,
151-
.post-detail__body h3,
152-
.post-detail__body h4,
153-
.post-detail__body h5,
154-
.post-detail__body h6 {
155-
color: var(--color-text-primary);
156-
font-family: var(--font-display);
157-
font-weight: var(--font-weight-medium);
158-
line-height: var(--line-height-tight);
159-
}
160-
161-
.post-detail__body h1 { font-size: var(--font-size-xl); }
162-
.post-detail__body h2 { font-size: var(--font-size-large); }
163-
.post-detail__body h3 { font-size: var(--font-size-medium); }
164-
.post-detail__body h4,
165-
.post-detail__body h5,
166-
.post-detail__body h6 { font-size: var(--font-size-base); }
167-
168-
.post-detail__body b,
169-
.post-detail__body strong {
170-
color: var(--color-text-primary);
171-
font-weight: var(--font-weight-medium);
172-
}
173-
17494
.post-detail__next,
17595
.post-detail__related {
17696
display: flex;

static/css/v3/release-highlights-card.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
color: var(--color-text-secondary);
5252
}
5353

54-
.release-highlight__description strong {
55-
font-weight: var(--font-weight-medium);
56-
}
54+
/* Rich-text rendering (bold/inline-code from inline_markdown) is handled by
55+
Boostlook via `.boostlook.release-highlight__description` in
56+
17-site-components.css; the description carries the `boostlook` class. */
5757

5858
.release-highlight__placeholder {
5959
padding: 0 var(--space-card);

templates/news/v3/detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</figure>
5050
{% endif %}
5151

52-
<div class="post-detail__body">
52+
<div class="post-detail__body boostlook">
5353
{% if object.external_url %}
5454
<p class="post-detail__external-url">
5555
<a href="{{ object.external_url }}" rel="noopener noreferrer" target="_blank" aria-label="Read full article: {{ object.title }} (opens in new tab)">{{ object.external_url }}</a>

templates/v3/includes/_content_modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h2 class="content-modal__title" id="{{ modal_id }}-title">{{ title }}</h2>
3838
{% endif %}
3939
<hr class="content-modal__divider" aria-hidden="true">
4040
<div class="content-modal__body" tabindex="0">
41-
<div class="content-modal__prose">{{ content|safe }}</div>
41+
<div class="content-modal__prose boostlook">{{ content|safe }}</div>
4242
</div>
4343
</div>
4444
</div>

templates/v3/includes/_markdown_card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<span class="card__title">{{ title }}</span>
1414
</div>
1515
<hr class="card__hr" aria-hidden="true" />
16-
<div class="card__column markdown-content">
16+
<div class="card__column markdown-content boostlook">
1717
{% if html %}{{ html|safe }}{% else %}{{ markdown|markdown }}{% endif %}
1818
</div>
1919
{% if button_url and button_label %}

templates/v3/includes/_release_highlights_card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<article class="release-highlight">
4141
<h3 class="release-highlight__title">{{ item.title }}</h3>
4242
{% if item.description %}
43-
<p class="release-highlight__description">{{ item.description|inline_markdown }}</p>
43+
<p class="release-highlight__description boostlook">{{ item.description|inline_markdown }}</p>
4444
{% endif %}
4545
</article>
4646
</li>

templates/v3/includes/_user_profile_bio_card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525
<hr class="card__hr" />
2626
{% endif %}
27-
<div class="card__column markdown-content">{{ markdown|markdown }}</div>
27+
<div class="card__column markdown-content boostlook">{{ markdown|markdown }}</div>
2828
{% if button_url and button_label %}
2929
<hr class="card__hr" />
3030
<div class="card__cta_section">

0 commit comments

Comments
 (0)