Skip to content

Layout & Grid

MetrePay uses a responsive, container-based layout system with a maximum width of 1280px. The grid progresses from single-column on mobile to 4 columns on wide screens.


Containers

Token Value Usage
--mp-container-max 1280px Catalog, dashboard, full-page layouts
--mp-container-form 720px Checkout cards, payment forms
--mp-container-narrow 480px Login forms, narrow modals

Container CSS

.mp-container {
  max-width: var(--mp-container-max);  /* 1280px */
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .mp-container { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 1024px) {
  .mp-container { padding-left: 32px; padding-right: 32px; }
}

Breakpoints

Name Value Description
Mobile < 768px Single column, full-width elements
Tablet ≥ 768px 2-column grid, sidebar adjustments
Desktop ≥ 1024px 3-column grid, full layout
Wide ≥ 1280px 4-column grid, max-width container

Product Grid

The catalog uses a responsive grid that adapts from 1 to 4 columns:

.catalog-products-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;                    /* Mobile: 1 col */
}

@media (min-width: 768px) {
  .catalog-products-grid {
    grid-template-columns: repeat(2, 1fr);        /* Tablet: 2 cols */
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .catalog-products-grid {
    grid-template-columns: repeat(3, 1fr);        /* Desktop: 3 cols */
  }
}

@media (min-width: 1280px) {
  .catalog-products-grid {
    grid-template-columns: repeat(4, 1fr);        /* Wide: 4 cols */
  }
}

Form Layout

Payment forms are always centered with a maximum width:

.checkout-wrapper {
  display: flex;
  justify-content: center;
  padding: 32px 20px;
}

.checkout-card {
  width: 100%;
  max-width: 720px;          /* --mp-container-form */
  background: #FFFFFF;
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--mp-shadow-card);
}

@media (min-width: 768px) {
  .checkout-card { padding: 32px; }
}

Split Checkout Layout (Stripe-inspired)

For subscription/recurrent payment flows, use the two-panel split layout:

.split-checkout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--mp-shadow-form);
}

.split-checkout__summary {
  background: var(--mp-gradient-hero);
  padding: 40px 32px;
  color: white;
}

.split-checkout__form {
  background: #FFFFFF;
  padding: 40px 32px;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .split-checkout {
    grid-template-columns: 1fr;
  }
}

Dashboard Layout (Portal)

The portal uses a fixed sidebar + main content layout:

.sidebar {
  width: 230px;
  height: 100%;
  position: fixed;
  background: #F4F4F4;
}

#main-content {
  margin-left: 230px;
}

/* Mobile: sidebar slides in */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    transform: translate(-230px, 0);
    transition: transform 0.3s ease-in-out;
  }

  #main-content {
    margin-left: 0;
  }
}

Horizontal Form Fields

Related fields are grouped horizontally on tablet and above:

<!-- Bulma -->
<div class="field is-horizontal">
  <div class="field-body">
    <div class="field">
      <label class="label">First name</label>
      <input class="input" type="text">
    </div>
    <div class="field">
      <label class="label">Last name</label>
      <input class="input" type="text">
    </div>
  </div>
</div>
/* Vanilla CSS */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .form-row--2cols {
    flex-direction: row;
  }
  .form-row--2cols > * {
    flex: 1;
  }
}

Layout Rules

Layout rules

  • Always center payment forms — never left-align them
  • Use max-width: 720px for single-column payment forms
  • Use max-width: 900px for split checkout layouts
  • Use max-width: 1280px for catalog and dashboard pages
  • Always add responsive container padding (20px → 24px → 32px)
  • Use the split checkout layout for subscription/recurrent flows
  • Use the single-column centered layout for one-time payment flows
  • Never use fixed pixel widths for form fields — use width: 100% with a container max-width