Page MenuHomePhabricator

[EPIC] Grid: Define a responsive column grid system in Codex
Open, In Progress, MediumPublic

Assigned To
Authored By
AAlhazwani-WMF
Dec 22 2021, 3:05 PM
Referenced Files
F62431748: Captura de pantalla 2025-06-23 a las 12.07.25.png
Jun 23 2025, 11:20 AM
F37030255: image.png
May 23 2023, 3:01 PM
F37030253: image.png
May 23 2023, 3:01 PM
Restricted File
May 11 2023, 9:54 AM
Restricted File
May 11 2023, 9:54 AM
F36992043: Vector22-Grid-proposal.png
May 11 2023, 9:51 AM

Description

Background

Starting from the EPIC T90687: Define a baseline grid and support a responsive grid system this subtask wants to scale, consolidate and share the existing work that @alexhollender_WMF and @KieranMcCann have been leading around a responsive column Grid.

User story

As a designer, I want to align components to a responsive column grid, so that I can define how elements move across different viewports. In order to achieve this I need to know how the grid changes across breakpoints T303522, which are those breakpoints, what are the outer margins of this grid, and which gutters are set between columns.

Impact

Grids are needed for any component with responsive behavior (Dialog, TypeheadSearch...)

Who needs this?

  • Readers web needs Dialog
  • Also related to the Page layout

What does it impact directly?

  • Dialog: grids need to size properly

Design spec + Guidelines

Grid proposal

Desktop Wide

  • 24 grid columns
  • 24px gutter
  • Margins scale according to the width of the screen
  • Max content width 1596px [current Vector 2022]

Desktop

  • 24 grid columns
  • 24px gutter
  • 32px margins (to max content width and then they scale)
  • Max content width 1596px

Tablet

  • 8 grid columns
  • 24px gutter
  • 24px margins

Mobile

  • 4 grid columns
  • 16px gutter
  • 16px margins

Open questions

  • Template areas. Where to define?
    • @Volker_E: On first sight this seems to be skin territory and from a MediaWiki agnosticism perspective, it might be better off to leave defining the areas there.
  • Where to put boundaries to skins? Universality of Codex Grid
    • Max content width of 1596px (99.75rem), comes out of Vector 2022. Others in our environment: 994px - Minerva, 980px - wikimediafoundation.org
    • Page margins. Part of the Grid?

Acceptance criteria for Done

Design

  • Create responsive Grid for all our breakpoints with the following specifications:
    • Number of columns
    • Max content width
    • Margins
    • Gutters
  • Test new Grid in the 3 most common page layouts: panel, no panel, full
  • Test grid in skins (New Vector, Vector Legacy and Minerva)
  • The responsive column grid is available as a layout grid in our Figma library
  • The Codex Style Guide features a new page detailing Grid guidelines and recommendations (T396777)

Code

Former implementations

DS Implementation inspirations elsewhere

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@alexhollender_WMF the use of the grid in that prototype is wrong. You are using the column gutters (separation between columns) to place the content but you should use the columns instead. This is what you should do:

Captura de Pantalla 2022-12-22 a las 17.45.07.png (1×2 px, 1 MB)

In this way, the separation between ToC - Content - Tools wouldn't be 32px but would be 24px instead.

@alexhollender_WMF the use of the grid in that prototype is wrong. You are using the column gutters (separation between columns) to place the content but you should use the columns instead. This is what you should do:

Captura de Pantalla 2022-12-22 a las 17.45.07.png (1×2 px, 1 MB)

I can't see the image you posted. To clarify: the dark red is the gutters, and the light red is the columns. As we discussed, in this version of the prototype the gutters are generally wider than the columns.

@alexhollender_WMF the use of the grid in that prototype is wrong. You are using the column gutters (separation between columns) to place the content but you should use the columns instead. This is what you should do:

Captura de Pantalla 2022-12-22 a las 17.45.07.png (1×2 px, 1 MB)

I can't see the image you posted.

@alexhollender_WMF sorry, my image was not public. Now you should view it. What I was explaining in the image is that, as documented in the Grid design proposal, you should use the following sizes in the desktop grid (from 1120px to 1679px screens):

  • Margins 32px
  • Gutters 24px
  • Max content width 1514px

To clarify: the dark red is the gutters, and the light red is the columns. As we discussed, in this version of the prototype the gutters are generally wider than the columns.

Ah ok, I misunderstood. Then the content is starting in the first grid column, well. In some cases the gutters could be bigger than the columns (e.g. in 1120px screens) but in all cases gutters should be 24px.

Static grid-areas

@bmartinezcalvo the current grid-area definitions are static, so the content area remains the same (15 columns) regardless of whether or not the tools menu is pinned or hidden:

tools menu hiddentools menu pinned
image.png (1×3 px, 1 MB)
image.png (1×3 px, 1 MB)

On larger screens this doesn't present an issue, however on smaller screens it means that the content gets squished more than it needs to, for example:

tools menu hidden (smaller screen)
image.png (1×2 px, 716 KB)
Dynamic grid-areas

One way to improve the layout for smaller screens would be for the grid-area definitions to be dynamic, so that the content area can take up more columns when the tools menu is hidden:

tools menu hiddentools menu pinned
image.png (1×2 px, 696 KB)
image.png (1×2 px, 718 KB)

One possible downside with this approach is that on larger screens, when the tools menu is hidden, the content will be wider than what we previously considered ideal (960px).

tools menu hidden
image.png (1×3 px, 1 MB)

This width of course depends both on the number of columns we allow the content to take up when the tools menu is hidden (16, 17, 18, or 19), as well as the max-width of the entire grid (which is currently set to 1650px in the prototype). This table is not comprehensive, just a start to help frame how we think about this:

content at 16 columnscontent at 17 columns
grid max-width: 1514pxcontent max-width: 1001pxcontent max-width: 1065px
grid max-width: 1650pxcontent max-width: 1092pxcontent max-width: 1161px

In addition to the number of columns the content takes up, and the max-width of the grid, other things could affect this:

  • media query so that the content takes up less columns again above a certain width
  • add a max-width on content area
  • increased font-size (which means the ideal width is then larger)

Prototype with 1650px max-width, and content area taking up 17 columns when tools menu is hidden: https://vector-2022.web.app/Moss

Dynamic grid-areas

One way to improve the layout for smaller screens would be for the grid-area definitions to be dynamic, so that the content area can take up more columns when the tools menu is hidden:

tools menu hiddentools menu pinned
image.png (1×2 px, 696 KB)
image.png (1×2 px, 718 KB)

@alexhollender_WMF I agree with using a dynamic layout to expand the content when the Tools panel is hidden. Also I agree with using 4 columns for the Tools panel since in the previous proposal we were using 3 col. instead, which causes the Tools panel to be too narrow on small desktop screens. So I agree with using a dynamic layout with 4col. Tools panel and expandable content area.

One possible downside with this approach is that on larger screens, when the tools menu is hidden, the content will be wider than what we previously considered ideal (960px).

tools menu hidden
image.png (1×3 px, 1 MB)

This width of course depends both on the number of columns we allow the content to take up when the tools menu is hidden (16, 17, 18, or 19), as well as the max-width of the entire grid (which is currently set to 1650px in the prototype). This table is not comprehensive, just a start to help frame how we think about this:

content at 16 columnscontent at 17 columns
grid max-width: 1514pxcontent max-width: 1001pxcontent max-width: 1065px
grid max-width: 1650pxcontent max-width: 1092pxcontent max-width: 1161px

I've explored this dynamic layout proposal testing both 16col. and 17col. for the expandable content area.

Screen sizeContent 16colContent 17 col
1120px696px741px
1440px909px967px
1536px973px1035px
1920px1002px1064px

I lean towards using the expandable content from 15col (tools displayed) to 16col (tools hidden) since the content area will be more aligned with the 960px ideal width. Since the grid max-width is 1514px, the max-content width will be 1002px which is just 42px more than the ideal content width.

Captura de Pantalla 2023-02-22 a las 16.58.13.png (1×1 px, 658 KB)


@alexhollender_WMF could you update the prototype with both 17col and 16col to compare both options?

Hi @bmartinezcalvo, is this something pending response from Web team folks? If so, would it make sense for @KieranMcCann to work with you on resolving?

Hi @bmartinezcalvo, is this something pending response from Web team folks? If so, would it make sense for @KieranMcCann to work with you on resolving?

@RHo I need to know if @KieranMcCann agrees with the new proposal of having a dynamic grid where central content will expand if the right panel (tools) is hidden. Please review my last comment above and the one from Alex. If you both agree with this, I will update the grid and layout proposal in this task and the layout documentation in the library.

@RHo @bmartinezcalvo I do agree with having a dynamic grid which allows for the article to expand to the right when the tools panel is hidden. There are, however, a couple things in the way of us moving forward with this at the moment. These being:

  • One of the outcomes of the recent Vector 2022 rfc is that there are community members who support a move towards full-width article content. Meaning that the article would just continue grow in width as the browser extends. This approach would have a big impact on how we approach the grid.
  • Also, as part of the next set of iterations to Vector 2022 the application of the grid has been descoped due to the technical complexity. That doesn’t block it in the future but something you should be aware of.

Happy to continue working on this but until the first point above is resolved then it we wouldn’t be able to come to a resolution.

Hey @KieranMcCann thank you for sharing this. I've updated the layout proposal applying your feedback related with the content full-width. We could use 4col for the tools panel and then expand the article content when the tools panel is hidden. With this new layout, we would solve the user's full-width request for the article content.

Captura de Pantalla 2023-03-27 a las 13.40.35.png (1×2 px, 1 MB)

This layout proposal uses the same grid solution we proposed some time ago (24col grid on desktop) so there is no problem with implementing one or another layout using this grid. In any case, I think it's worth implementing a grid so we can unify the margins and visual structure in all our projects.

Hey @KieranMcCann thank you for sharing this. I've updated the layout proposal applying your feedback related with the content full-width. We could use 4col for the tools panel and then expand the article content when the tools panel is hidden. With this new layout, we would solve the user's full-width request for the article content.

Captura de Pantalla 2023-03-27 a las 13.40.35.png (1×2 px, 1 MB)

This layout proposal uses the same grid solution we proposed some time ago (24col grid on desktop) so there is no problem with implementing one or another layout using this grid. In any case, I think it's worth implementing a grid so we can unify the margins and visual structure in all our projects.

Hi @bmartinezcalvo. Just to clarify that this updated proposal still appears to have a max-width on the content of 1514px. If we end up going with the current suggestion, from some community members, not to have any width limitation, then the grid approach would need to change. Myself and @RHo were discussing this earlier and there may be a few options:

  • have a breakpoint at a large width where we switch from the grid to a % based flexible layout that follows the column ratios on the max width
  • as above but we have a mix-width on the menus and allow the width of the article content to flex

Either way I think it might be useful to hold off on making any final grid decision this until we have a clearer direction on this. Will keep you posted!

Hi @bmartinezcalvo. Just to clarify that this updated proposal still appears to have a max-width on the content of 1514px. If we end up going with the current suggestion, from some community members, not to have any width limitation, then the grid approach would need to change.

@KieranMcCann oh yes, sorry, I misunderstood your previous comment. So the right new proposal would be this one instead, with no max-width limitation on big screens:

Captura de Pantalla 2023-03-29 a las 11.39.44.png (1×2 px, 1 MB)

I would avoid using a no max-width limitation since the reading experience will not be the best and the content would be too wide on some big screens, specially when the tools panel is hidden.

Myself and @RHo were discussing this earlier and there may be a few options:

  • have a breakpoint at a large width where we switch from the grid to a % based flexible layout that follows the column ratios on the max width
  • as above but we have a mix-width on the menus and allow the width of the article content to flex

Either way I think it might be useful to hold off on making any final grid decision this until we have a clearer direction on this. Will keep you posted!

I agree, let's discuss this when we have a clearer direction.

Hi @bmartinezcalvo. Just to clarify that this updated proposal still appears to have a max-width on the content of 1514px. If we end up going with the current suggestion, from some community members, not to have any width limitation, then the grid approach would need to change.

@KieranMcCann oh yes, sorry, I misunderstood your previous comment. So the right new proposal would be this one instead, with no max-width limitation on big screens:

Captura de Pantalla 2023-03-29 a las 11.39.44.png (1×2 px, 1 MB)

Once direction/decision has been made on the full-width issue, I recommend updating this diagram to show how it would work on very wide screens beyond the grid max breakpoint.

I would avoid using a no max-width limitation since the reading experience will not be the best and the content would be too wide on some big screens, specially when the tools panel is hidden.

Agree, this has been the design recommendation throughout, but conversation is ongoing.

Myself and @RHo were discussing this earlier and there may be a few options:

  • have a breakpoint at a large width where we switch from the grid to a % based flexible layout that follows the column ratios on the max width
  • as above but we have a mix-width on the menus and allow the width of the article content to flex

Either way I think it might be useful to hold off on making any final grid decision this until we have a clearer direction on this. Will keep you posted!

I agree, let's discuss this when we have a clearer direction.

Here is the latest proposal for the grid with particular reference to how it behaves with Vector 2022. This proposal takes into account:

  • community feedback requesting a full width option that can be toggled to allow no width restriction
  • the likely introduction of the ‘Zebra 9’ design changes which has introduced larger padding on the article and menus and therefore reduced content column widths.

The key changes from the previous proposal include:

  • ToC and Tools columns are now the same width to create a symmetrical layout when both menus are pinned. The column distribution is 4/16/4
  • In ‘restricted width mode’ the article does not change size or position when menus are hidden.
  • In ‘restricted width mode’ the maximum width has been increased to 1618px to compensate for the increased padding introduced by the Zebra design which reduced the article text column width.
  • Addition of ‘full width mode’ where the grid has no max-width.
    • In ‘full-width mode’, when menus are hidden the article expands to fill the empty columns. This behaviour is different from ‘restricted width mode’.

{F36992048}
{F36992049}

Figma file

Here is the latest proposal for the grid with particular reference to how it behaves with Vector 2022. This proposal takes into account:

  • community feedback requesting a full width option that can be toggled to allow no width restriction
  • the likely introduction of the ‘Zebra 9’ design changes which has introduced larger padding on the article and menus and therefore reduced content column widths.

The key changes from the previous proposal include:

  • ToC and Tools columns are now the same width to create a symmetrical layout when both menus are pinned. The column distribution is 4/16/4
  • In ‘restricted width mode’ the article does not change size or position when menus are hidden.
  • In ‘restricted width mode’ the maximum width has been increased to 1618px to compensate for the increased padding introduced by the Zebra design which reduced the article text column width.
  • Addition of ‘full width mode’ where the grid has no max-width.
    • In ‘full-width mode’, when menus are hidden the article expands to fill the empty columns. This behaviour is different from ‘restricted width mode’.

{F36992048}
{F36992049}

Figma file

Adding in non-restricted versions of above images (since KieranMcCann is no longer active)

image.png (1×1 px, 237 KB)

image.png (1×2 px, 217 KB)

egardner raised the priority of this task from Medium to Needs Triage.Oct 2 2023, 9:14 PM
egardner moved this task from Needs Refinement to Backlog on the Design-System-Team board.
CCiufo-WMF moved this task from Now to Parking Lot on the Design-System-Team (Roadmap) board.
CCiufo-WMF added a project: Epic.
CCiufo-WMF added a subscriber: bmartinezcalvo.
CCiufo-WMF changed the task status from In Progress to Open.Feb 15 2024, 8:28 PM
CCiufo-WMF renamed this task from Define a responsive column grid system to [EPIC] Define a responsive column grid system.Mar 8 2024, 5:26 PM
bmartinezcalvo renamed this task from [EPIC] Define a responsive column grid system to [EPIC] Grid: Define a responsive column grid system in Codex.Mar 13 2025, 11:45 AM
CCiufo-WMF changed the task status from Open to In Progress.May 12 2025, 4:08 PM
CCiufo-WMF assigned this task to Volker_E.
CCiufo-WMF moved this task from Next to Now on the Design-System-Team (Roadmap) board.

Sharing here the updated proposal for the Grid being implemented in T337282.

Captura de pantalla 2025-06-23 a las 12.07.25.png (576×1 px, 48 KB)

Based on the existing page's layouts across projects, the grid could be used to cover the following layouts. At breakpoints desktop-wide and desktop there will be max-width of 1514px, and side panels might be visible; while the content will be full-width at breakpoints tablet and mobile, with the side panels collapsed as default and displayed as overlays when needed.

  • 2-panel layout: The main content area spans 16 columns, with a collapsible 4-column panel on each side.
  • 1-panel layout: The main content spans 20 columns, with a collapsible 4-column side panel. This layout is typically used when only one of the two panels from the 2-panel layout is visible.
  • No-panel layout: The content spans 16 columns, leaving 4 columns of margin on each side. This ensures visual consistency in case side panels are expanded.
  • Full-width layout: The content spans 100% of the grid at any screen size. This layout is typically used when both side panels from the 1-panel or 2-panel layout are collapsed.

Currently, side panels in Vector 2022 have a fixed width that only changes at specific breakpoints. With the new grid system, this behavior will change: side panels will span 4 columns of the grid, meaning their width will adjust fluidly as the screen is resized, rather than only at predefined breakpoints.

Grabaciondepantalla2025-06-23alas13.18.40-ezgif.com-video-to-gif-converter.gif (381×800 px, 3 MB)
Grabaciondepantalla2025-06-23alas13.13.27-ezgif.com-video-to-gif-converter.gif (448×800 px, 2 MB)
Current side panels in Vector22Grid columns resizing