Skip to content

Conversation

@wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Dec 19, 2025

Overview

Important

To Do

Fix alignment and size of:

  1. main image (on news article page):
    • narrow image, narrow screen
    • full-width image1, narrow screen
    • narrow image, wide screen
    • full-width image1, wide screen
  2. thumbnail image (on news feed page and embed):
    • narrow image, narrow screen
    • full-width image1, narrow screen
    • narrow image, wide screen
    • full-width image1, wide screen

Related

Changes

  • renamed mixins to express what its styles do
    • news-article-page__media--slim-context…--layout-center
    • news-article-page__media--wide-context…--layout-float
  • changed mixin …--layout-center to be used only if main image thumb. opt. has 0 width
  • fixed unaligned blog content images
  • deleted unnecessary code
  • fixed large article list image from overflowing list
  • fixed small article list image from not filling item
  • changed overwritten code to be reminder comment instead
  • moved mixins news-article-page__media--…
    • from x-news.css
    • to django.cms.blog.app.page.css
  • changed markup of form to choose news list layout
  • added thumb. opt. values into HTML (for CSS)
    • data-width
    • data-height

Testing

Given an article main image of thumbnail size with width = 0:

  • On news article page, that image should be:
    • as wide as content
  • On news feed page (and feed embed):
    • In list view:
      • On a wide screen (1 wide column),
        that image should be no wider than 50%.
      • On a narrow screen (1 narrow column),
        that image should shrink to fit item.
    • In grid layout2:
      • On a wide screen (N narrow columns),
        that image should shrink to fit item.
      • On a narrow screen (1 narrow column),
        that image should shrink to fit item.

Given an article main image of thumbnail size with width > 0:

  • On news article page, that image should be:
    • no wider than 50% of content
    • right-aligned
  • On news feed page (and feed fembed):
    • In list view:
      • On a wide screen (1 wide column),
        that image width should define media grid cell width.
      • On a narrow screen (1 narrow column),
        that image should grow to fit item.
    • In grid view:
      • On a wide screen (N narrow columns),
        that image should grow to fit item.
      • On a narrow screen (1 narrow column),
        that image should grow to fit item.

UI

Skipped.

Footnotes

  1. I.e. use a Thumbnail Option with width of 0. 2 3 4

  2. This is a secret layout. Unhide the #layout-choice-form element to reveal the layout options.

Given an article main image of thumbnail size with no set width,
Then that image should not be shrunk less than width of content.
@wesleyboar wesleyboar marked this pull request as draft December 19, 2025 19:40
Given a news feed image of thumbnail size with large width,
Then that image should not be shrunk less if space is available.

BUG: If on grid layout (e.g. narrow screen), 300 width image too narrow.
There is only one column. Value of grid-template-areas illustrates that. New elements are added as row.
The removed value is always (i.e. at every screen, by every use case) override by grid-template-columns.
@wesleyboar wesleyboar changed the title fix: full width article main image not stretching fix: article image alignment and sizing Jan 8, 2026
@wesleyboar wesleyboar marked this pull request as ready for review January 8, 2026 00:47
wesleyboar added a commit that referenced this pull request Jan 8, 2026
## Overview

Minimally style the news layout options form.

## Related

- helps when testing #1050

## Changes

- **changed** markup

## Testing

0. Open a News feed page.
1. Remove `hidden` attribute from form.
2. Click form options.
3. Verify news layout changes (on wide screen).

## UI

| before | after |
| - | - |
| <img width="310" height="430" alt="news layout form BEFORE"
src="https://github.com/user-attachments/assets/7bbfd924-6754-40ac-92c5-440e6fe158fb"
/> | <img width="310" height="430" alt="news layout form AFTER"
src="https://github.com/user-attachments/assets/dea7ce3a-e350-436f-aba2-faa74798c00d"
/> |
@wesleyboar wesleyboar merged commit 992f1d4 into stable Jan 8, 2026
@wesleyboar wesleyboar deleted the fix/full-width-article-main-image-not-stretching-on-wide-screen branch January 8, 2026 17:30
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.

2 participants