naumch1k / one-fall

Landing page for ONE FALL, Salem-based melodic punk and hardcore quartet has rapidly made a mark in New England
https://develop--one-fall.netlify.app/
0 stars 0 forks source link

REFACTOR: Refine Sections Content Width #23

Closed naumch1k closed 3 months ago

naumch1k commented 3 months ago

Description

This PR addresses minor layout inconsistencies related to the width of page sections and removes the minimum width restriction, which was causing bugs on smaller mobile devices.

Task Link

Project Figma

Changes Made

Screenshots, GIFs, or videos

The video below illustrates how the minimum width restriction was causing horizontal scrolling on mobile devices with screens less than 414px wide:

https://github.com/user-attachments/assets/6adebd5d-3bee-4451-bfbf-6e8184f8a388

Usage

By setting up the --max-content-width and --page-side-padding CSS variables in globals.css, we can now simplify most section setups and make them easier to maintain for future design changes.

/* globals.css */
:root {
  --max-content-width: 1184px;
  --page-side-padding: 16px;
  ...
}

@media screen and (min-width: 768px) {
  :root {
    --page-side-padding: 24px;
  }
}

@media screen and (min-width: 1272px) {
  :root {
    --page-side-padding: 48px;
  }
}

This simplified setup will ensure the correct section width across all devices.

.root {
  width: 100%;
  max-width: calc(100% - (var(--page-side-padding) * 2));
  margin: 0 auto;
}

@media screen and (min-width: 1272px) {
  .root {
    max-width: var(--max-content-width);
  }
}
netlify[bot] commented 3 months ago

Deploy Preview for one-fall ready!

Name Link
Latest commit 5d7d166a70aa0b14ea27157036802046ba089d45
Latest deploy log https://app.netlify.com/sites/one-fall/deploys/66a28ff9730a570008957d9f
Deploy Preview https://deploy-preview-23--one-fall.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.