Skip to content

Commit 644cd19

Browse files
committed
Move post detail styling to boostlook
post-detail__body carries the boostlook class and pulls rich-text styling from the vendored boostlook-v3.css. post-detail.css keeps only layout and chrome, rich-text rules left as a pointer. Depends on the matching boostlook commit.
1 parent 572afe0 commit 644cd19

3 files changed

Lines changed: 77 additions & 89 deletions

File tree

static/css/v3/boostlook-v3.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5745,3 +5745,71 @@ html.v3 .boostlook {
57455745
border: none;
57465746
border-radius: 0;
57475747
}
5748+
5749+
/* Post detail (news article body) — #2491. The container keeps its layout
5750+
(flex/gap/border) in post-detail.css; the rich-text typography lives here.
5751+
Body copy is intentionally secondary grey (overrides the non-doc primary
5752+
default above); headings and bold use primary. */
5753+
.boostlook.post-detail__body {
5754+
color: var(--color-text-secondary);
5755+
font-size: var(--font-size-base);
5756+
line-height: var(--line-height-loose);
5757+
letter-spacing: var(--letter-spacing-tight);
5758+
}
5759+
5760+
.boostlook.post-detail__body a {
5761+
color: inherit;
5762+
text-decoration: underline;
5763+
}
5764+
5765+
.boostlook.post-detail__body img {
5766+
max-width: 100%;
5767+
height: auto;
5768+
border-radius: var(--border-radius-m);
5769+
}
5770+
5771+
.boostlook.post-detail__body :is(pre, code) {
5772+
font-family: var(--font-code);
5773+
font-size: var(--font-size-small);
5774+
}
5775+
5776+
.boostlook.post-detail__body pre {
5777+
padding: var(--space-medium);
5778+
border-radius: var(--border-radius-m);
5779+
background: var(--color-surface-mid);
5780+
overflow-x: auto;
5781+
}
5782+
5783+
/* Rhythm between blocks comes from the container's flex `gap`, so strip the
5784+
block margins boostlook's bare-markdown layer adds; otherwise they stack on
5785+
the gap and the spacing doubles. Lists stay tight (as v2 had them). */
5786+
.boostlook.post-detail__body :is(p, ul, ol, li, pre, h1, h2, h3, h4, h5, h6) {
5787+
margin: 0;
5788+
}
5789+
5790+
.boostlook.post-detail__body :is(ul, ol) {
5791+
padding-left: var(--space-large);
5792+
list-style-position: outside;
5793+
}
5794+
5795+
.boostlook.post-detail__body ul { list-style-type: disc; }
5796+
.boostlook.post-detail__body ol { list-style-type: decimal; }
5797+
.boostlook.post-detail__body ul ul { list-style-type: circle; }
5798+
.boostlook.post-detail__body :is(ol ol, ul ol) { list-style-type: lower-alpha; }
5799+
5800+
.boostlook.post-detail__body :is(h1, h2, h3, h4, h5, h6) {
5801+
color: var(--color-text-primary);
5802+
font-family: var(--font-display);
5803+
font-weight: var(--font-weight-medium);
5804+
line-height: var(--line-height-tight);
5805+
}
5806+
5807+
.boostlook.post-detail__body h1 { font-size: var(--font-size-xl); }
5808+
.boostlook.post-detail__body h2 { font-size: var(--font-size-large); }
5809+
.boostlook.post-detail__body h3 { font-size: var(--font-size-medium); }
5810+
.boostlook.post-detail__body :is(h4, h5, h6) { font-size: var(--font-size-base); }
5811+
5812+
.boostlook.post-detail__body :is(b, strong) {
5813+
color: var(--color-text-primary);
5814+
font-weight: var(--font-weight-medium);
5815+
}

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;

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>

0 commit comments

Comments
 (0)