scratchfoundation / scratchfoundation/scratch-www

Flex Row switching to be column on mobile is problematic

Open
#2,139 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mobile tech debt
Dominant language
JavaScript
Stars
1.7k
Forks
924
Avg merge
3d 8h
Merged PRs (30d)
10

Description

The Flex Row component switches to flex direction = column starting tablet size and smaller.
https://github.com/LLK/scratch-www/blob/9b94849de6e1f40a687b68433e76ff3e0ba4f6dc/src/components/flex-row/flex-row.scss#L29
This is often not the preferred OR expected behavior. But Flex Row is being used in many places so just simply changing the code in the flex row css would maybe be risky. This has lead to workarounds such as declaring extra classes and appending them to a flex row component to actually preserve the row, or many media queries on the new project page.

What I expect of Flex Row is that it only becomes a column on mobile if it is &column or maybe &column-mobile. Maybe a new component FlexTrueRow is needed if changing Flex Row itself is too annoying. Or just add a part to the flex row css that is like

media query stuff {
  .preserve-row-on-mobile {
    flex-direction: row;
  }
}

and add this class to all places where workarounds via media queries and extra classes have been used.

Ref https://github.com/LLK/scratch-www/pull/2135#pullrequestreview-161201022

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/components/flex-row/flex-row.scss at the linked media-query rule, then inspect the Flex Row usages and the workarounds referenced in the issue and PR 2135 review. Resolve which mobile behavior is intended before changing the component, and consider the affected usages complete when they no longer require separate row-preserving media-query workarounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
scss
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.