A short intro to the article that encourages the click and the full read...
Read moreBlog & Articles
Four components for news portals and company blogs - from an
article grid to an author section. They require a separate
molique-style-blog.css file. Full layouts are in
the examples:
posts,
sidebar,
author.
1. What to choose
Four independent components - none requires the others.
| Component | When | Built on |
|---|---|---|
.post-card |
An article grid - blog home page, category. | Flexbox |
.blog-post |
Classic list of posts, one below another - archive, search results. | Flexbox |
.simple-post-list |
A "Latest posts" widget in a sidebar or footer. | Flexbox |
.author-box |
An author block - typically at the very bottom of an article's content. | Flexbox |
2. Post Card
A card for a grid, with a date floating over the image and a meta section (author, category) above the title.
<article class="post-card">
<a href="#" class="post-image-wrapper">
<div class="post-date-badge">
<span class="day">24</span>
<span class="month">May</span>
</div>
<img src="photo.jpg" alt="Thumbnail">
</a>
<div class="post-content">
<div class="post-meta">
<span><svg class="icon" aria-hidden="true"><use href="img/icons-sprite.svg#ph-user"></use></svg> Admin</span>
</div>
<a href="#" class="post-title">Article title</a>
<p>Excerpt...</p>
</div>
</article>
| Class | What it does |
|---|---|
.post-card |
The wrapper. height: 100% - aligns to the tallest card in a grid row. |
.post-image-wrapper |
On an <a>. position: relative
- the anchor for .post-date-badge. The
image has a fixed 240px height, regardless of the
original's aspect ratio.
|
.post-date-badge |
Absolutely positioned in the top-left corner.
Must be inside
.post-image-wrapper - see the pitfall
below.
|
.post-content |
The rest of the card below the image. flex-grow: 1. |
.post-meta |
A row of metadata (author, category…) above the title. Not to be confused with .post-meta-date from the sidebar widget - see the pitfall below. |
.post-title |
The title. Turns --primary on hover. |
3. Classic post (List View)
The traditional blog-archive layout - a large, calendar-style
date to the left of the image. Below the sm
breakpoint the date jumps above the image and the layout
becomes vertical.
<article class="blog-post">
<div class="post-date">
<span class="month">May</span>
<span class="day">24</span>
</div>
<div class="flex-grow-1">
<a href="#" class="blog-post-image"><img src="photo.jpg" alt=""></a>
<div class="post-meta">...</div>
<a href="#" class="post-title">Post title</a>
<p>Excerpt text...</p>
</div>
</article>
| Class | What it does |
|---|---|
.blog-post |
A row. Has a divider line below; the last post in the
list doesn't (:last-child).
|
.post-date |
A 55px calendar column. Contains .month
and .day - the same names as in
.post-date-badge, but with a
different look: here the month is a
top bar in --primary, the day a white
card underneath. See the pitfall below.
|
.blog-post-image |
The image above the title, with no floating date. Free height (height: auto). |
4. Compact post list (Sidebar Widget)
A compact list with thumbnails - "Latest posts" in a sidebar or footer.
<ul class="simple-post-list">
<li>
<img src="thumb.jpg" class="post-image" alt="Thumbnail">
<div class="post-info">
<a href="#">Article title</a>
<span class="post-meta-date">May 24, 2026</span>
</div>
</li>
</ul>
| Class / variable | What it does |
|---|---|
.simple-post-list |
On a <ul>. Resets list styling, adds a dotted separator between items. |
.post-image |
The thumbnail. Styled EXCLUSIVELY inside
.simple-post-list - outside it, it's a
plain <img> with no rules at all.
|
--post-thumb-size |
The thumbnail size (defaults to 60px). Set via style="--post-thumb-size: 48px;" on .simple-post-list or a single <li>. |
.post-info |
The title + date column, only inside .simple-post-list. |
.post-meta-date |
A small date below the title. Not to be confused with .post-meta from the card and classic post - a different class, a different look. |
5. Author Box
A block placed below an article. Below the sm
breakpoint the layout centers itself and becomes vertical
(avatar above the text).
<div class="author-box">
<img src="avatar.jpg" alt="Author" class="author-avatar">
<div class="author-info">
<h4 class="author-name">Full name</h4>
<div class="author-role">Role</div>
<p class="author-bio">Author bio...</p>
</div>
</div>
| Class | What it does |
|---|---|
.author-box |
The wrapper. On mobile: flex-direction: column, centered. |
.author-avatar |
A round 80×80px avatar, object-fit: cover. |
.author-info |
The text column. The parent for .author-name, .author-role, .author-bio - they only work inside it. |
6. Pitfalls
1
.day / .month look different in every context
The same class names have TWO different styles in Sass,
depending on the parent: inside
.post-date-badge (the date floating on a
photo), the day is a large number over a small month;
inside .post-date (classic list), the month
is a top bar in --primary, and the day a
white card underneath. Used outside both - they have no
style at all.
2
.post-date-badge outside .post-image-wrapper
The date is positioned position: absolute
and anchors to the nearest ancestor with
position: relative - that ancestor is
.post-image-wrapper. Placed anywhere else,
it will stick to a farther-up ancestor or the whole page
instead of the corner of the image.
3
.post-meta and .post-meta-date are not the same class
Deceptively similar names, zero shared code.
.post-meta (card, classic post) is a row of
links with icons. .post-meta-date (sidebar
widget) is a single, small date text. Swapping one for
the other won't translate 1:1 visually.