Skip to content

Use explicit .post-description class for blog listing description (closes #296)#320

Merged
pftg merged 1 commit into
masterfrom
twill/fix-296-add-post-description-css-class-for-blog-listing--VL51Cwp
May 4, 2026
Merged

Use explicit .post-description class for blog listing description (closes #296)#320
pftg merged 1 commit into
masterfrom
twill/fix-296-add-post-description-css-class-for-blog-listing--VL51Cwp

Conversation

@twill-hq
Copy link
Copy Markdown
Contributor

@twill-hq twill-hq Bot commented May 4, 2026

Task created from Twill by Paul Keen.

Summary

Replaces the fragile positional selector .post-content > div:last-child with an explicit .post-description class on the blog post listing description. Closes #296.

The positional selector breaks silently if the post card markup grows another trailing element. An explicit class survives template restructuring.

Changes

  • themes/beaver/layouts/blog/list.html — added class="post-description" to the <div> rendering .Params.description.
  • themes/beaver/assets/css/homepage-layout.css — replaced selector in both the main rule and the @media (max-width: 860px) rule. Rule body is identical (font-size: 0.85em, line-height: 1.5, color: #555, margin-top: 6px).

Verification

  • bin/hugo-build passed (Hugo 0.161.1, matches CI).
  • 10 .post-description elements render on /blog/ index.
  • Computed styles on the rendered description match pre-change values:
    • font-size: 15.3px (= 0.85em)
    • line-height: 22.95px (= 1.5)
    • color: rgb(85, 85, 85) (= #555)
    • margin-top: 6px
  • Mobile (window.innerWidth = 375): display: none — media query still hides description.
  • rg confirms no other rule depended on .post-content > div:last-child and no other consumer references it.

Visual evidence

Desktop (1280px) — descriptions visible:

Blog listing desktop

Mobile (375px) — descriptions hidden by media query, matching pre-change behavior:

Blog listing mobile

Note on test gates

The CLAUDE.md visual regression gate normally runs bin/test and bin/dtest. Those Ruby/Docker harnesses are not available in this sandbox, so this PR substitutes:

  1. A clean Hugo build matching CI's Hugo version.
  2. Direct DOM and computed-style assertions on the rendered output (above).
  3. Desktop + mobile screenshots showing identical visual output.

CSS specificity does increase from (0,0,2) to (0,1,0), but the rule sits in a self-contained block with no competing selectors targeting .post-description, so behavior is preserved.

Test plan

  • CI build (_hugo.yml) passes
  • Verify /blog/ description rendering on the Preview (desktop + < 860px viewport)
  • Maintainer runs bin/test and bin/dtest locally if visual baseline parity is required

View on Twill

You can tag @twill anywhere in this PR to follow up.

…cription

Replaces the fragile positional selector `.post-content > div:last-child`
with an explicit `.post-description` class. The positional selector breaks
silently if the blog post card markup grows another trailing element.

- themes/beaver/layouts/blog/list.html: add class="post-description" to
  the div rendering .Params.description
- themes/beaver/assets/css/homepage-layout.css: replace selector in both
  the main rule and the @media (max-width: 860px) rule; rule body
  unchanged (font-size 0.85em, line-height 1.5, color #555, margin-top 6px)

Verified: 10 .post-description elements render on /blog/ index, computed
styles match pre-change values (15.3px / 22.95px / rgb(85,85,85) / 6px),
and the mobile media query still hides the description at 375px. Hugo
build passes.

Closes #296

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@pftg pftg merged commit f1aeb21 into master May 4, 2026
3 checks passed
@pftg pftg deleted the twill/fix-296-add-post-description-css-class-for-blog-listing--VL51Cwp branch May 4, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add explicit CSS class for blog post description in listing

1 participant