[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Page MenuHomePhabricator

Responsiveness: Explore how to create responsive layouts in Codex
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

There are different issues related with responsive layouts across projects, primarily due to a lack of breakpoint and layout strategies. This task is to collaborate with an engineer to explore potential solutions for creating a flexible, responsive layout in Codex.

Acceptance criteria (or Done)

  • Explore with an engineer possible alternatives to create a flexible layout solution
  • File a follow-up spike task (T379395) to prototype the chosen approach

Event Timeline

CCiufo-WMF renamed this task from Responsiveness: Explore how to solve layout issues to Responsiveness: Explore how to create responsive layouts in Codex.Oct 28 2024, 3:40 PM
CCiufo-WMF removed a project: Epic.
CCiufo-WMF moved this task from Inbox to Needs Refinement on the Design-System-Team board.
CCiufo-WMF triaged this task as Medium priority.Oct 28 2024, 4:20 PM

Hey @bmartinezcalvo, I'd like to propose some ideas for consideration here.

I think that we would benefit from thinking about layouts as another type of component in our library. Here are some example "layout components" we could include:

  • Container
  • Section
  • Hero / banner image
  • Media Object
  • NavBar
  • Columns
  • Grid
  • Divider

Just like other components, we could offer these in both CSS-only and Vue versions. Maybe the Card component should already be considered part of this category too (also Tabs and Accordion maybe).

Some of these components might be very basic (for example, a CdxContainer might just be a <div> element with some basic margins or padding applied). Others might define some optional styles that users may or may not use in all situations (a Section component could give special treatment to heading or subheading text inside it for example, to help create consistent typographic styles). A Colums component would probably use Flexbox for styling, while a Grid component might use CSS Grid. Nesting of components would probably be common here as well (perhaps you have a Section component which contains Columns full of Media Objects on a dashboard page).

I think that starting with "building blocks" like this, as opposed to top-level "page" layouts, will be more useful. In MediaWiki a lot of top-level styling is still going to come from the skins, but having a set of Layout components would let people build out things like Special pages in consistent ways from a series of re-usable parts.

I could see T309109 being relevant to this task – if we add a bunch of new related layout components to the docs site, it would be helpful to group them together.

For inspiration, I would suggest looking at the layout components defined by Bulma, a CSS-based component library that follows a lot of good practices.

For example, Bulma has a container layout (basically a CSS-only component) that applies some basic responsive styles, but it also has a few options that can be specified by the user (like whether to use a fixed max width and center, or whether to be "fluid" and fill the whole page). Their section layout applies more margins/padding and comes in "medium" and "large" variants.

Advantages of a component-based approach to layout:

  • Everything is a component, so it's easy to fit this into our current approach
  • We already have the tools to document components in our site
  • Users can choose either Vue-based or CSS-only based versions of these components, based on whatever is more convenient in their feature
  • Users won't need to use LESS to load these styles

I think you are heading in the right direction Eric! Really like how Bulma is approaching this, makes a lot of sense quickly. I think deciding what the core components are to create a responsive layout for most of our future use cases will be interesting, for example, we probably don't need to support nav or hero for v1?

Also out of curiosity, I poked around some of design systems to see how others are approaching this, I think its worthwhile to see how much is similar and where things differ:

egardner updated the task description. (Show Details)

We will use https://phabricator.wikimedia.org/T379395 to prototype this approach for a basic Container component. If that works well we will write an ADR documenting this (as part of that task).