Grid System

A flexible 12-column grid system for creating consistent, responsive layouts across all Cynosure products.

Grid System

The Cynosure grid system provides a flexible, responsive layout foundation built on a 12-column structure. It ensures consistent spacing, alignment, and breakpoint behavior across all products and interfaces.


Grid Structure

The grid system consists of three main components:

  1. Container (o-container): Wraps content and provides max-width constraints
  2. Row (o-row): Creates a horizontal group of columns
  3. Columns (o-col-{number}): Defines the width of content areas

Basic Grid Settings

  • Number of columns: 12
  • Gutter width: 42px

These settings are defined in settings/_grid.scss:

SCSS
1$grid-columns: 12 !default; 2$grid-gutter: 42px !default;

Breakpoints

The grid system uses the following breakpoints for responsive behavior:

BreakpointValueDescription
xs0pxExtra small devices (default, mobile-first)
sm576pxSmall devices (landscape phones)
md769pxMedium devices (tablets)
lg992pxLarge devices (desktops)
xl1254pxExtra large devices (large desktops)

Usage

Basic Grid Layout

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12"> 4 <!-- Full width content --> 5 </div> 6 </div> 7</div>

Responsive Columns

Use breakpoint-specific column classes to create responsive layouts:

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12 o-col-6@md o-col-4@lg"> 4 <!-- Full width on mobile, half width on tablet, one-third on desktop --> 5 </div> 6 <div class="o-col-12 o-col-6@md o-col-4@lg"> 7 <!-- Same responsive behavior --> 8 </div> 9 <div class="o-col-12 o-col-6@md o-col-4@lg"> 10 <!-- Same responsive behavior --> 11 </div> 12 </div> 13</div>

Column Classes

Column classes follow the pattern: o-col-{number} or o-col-{number}@{breakpoint}

  • o-col-1 through o-col-12: Column widths from 1/12 to 12/12 (full width)
  • o-col-{number}@{breakpoint}: Responsive column widths at specific breakpoints

Examples:

  • o-col-12: Full width (12/12 columns)
  • o-col-6: Half width (6/12 columns)
  • o-col-4: One-third width (4/12 columns)
  • o-col-3: One-quarter width (3/12 columns)
  • o-col-6@md: Half width starting at medium breakpoint
  • o-col-4@lg: One-third width starting at large breakpoint

Offsets

Use offset classes to push columns to the right, creating spacing or centering content:

Offset Classes

  • o-offset-{number}: Offset by number of columns (default/xs breakpoint)
  • o-offset-{number}@{breakpoint}: Offset at specific breakpoint

Examples:

  • o-offset-1: Push column 1 column to the right
  • o-offset-3@md: Push column 3 columns to the right starting at medium breakpoint
  • o-offset-4@lg: Push column 4 columns to the right starting at large breakpoint

Centering Content

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-8@md o-offset-2@md"> 4 <!-- Centered content: 8 columns wide, offset by 2 columns --> 5 </div> 6 </div> 7</div>

Offset Implementation

Offsets are implemented using margin-inline-start to support RTL (right-to-left) languages:

SCSS
1.o-offset-#{$i} { 2 margin-inline-start: $column-width; 3}

Best Practices

1. Always Use Container

Wrap your grid layouts in o-container to ensure consistent max-widths and horizontal padding:

HTML
1<!-- Good --> 2<div class="o-container"> 3 <div class="o-row"> 4 <div class="o-col-12">Content</div> 5 </div> 6</div> 7 8<!-- Avoid --> 9<div class="o-row"> 10 <div class="o-col-12">Content</div> 11</div>

2. Mobile-First Approach

Start with mobile (xs) classes and progressively enhance for larger screens:

HTML
1<!-- Good: Mobile-first --> 2<div class="o-col-12 o-col-6@md o-col-4@lg">Content</div> 3 4<!-- Avoid: Desktop-first --> 5<div class="o-col-4 o-col-12@sm">Content</div>

3. Column Totals Should Equal 12

Within a row, column widths should add up to 12 (or less, leaving empty space):

HTML
1<!-- Good: Columns total 12 --> 2<div class="o-row"> 3 <div class="o-col-6">6 columns</div> 4 <div class="o-col-6">6 columns</div> 5</div> 6 7<!-- Also valid: Columns total less than 12 --> 8<div class="o-row"> 9 <div class="o-col-4">4 columns</div> 10 <div class="o-col-4">4 columns</div> 11 <!-- 4 columns of empty space --> 12</div>

4. Use Responsive Classes Appropriately

Apply breakpoint-specific classes only when layout changes are needed:

HTML
1<!-- Good: Clear responsive behavior --> 2<div class="o-col-12 o-col-6@md o-col-4@lg">Content</div> 3 4<!-- Avoid: Unnecessary classes --> 5<div class="o-col-12 o-col-12@md o-col-12@lg">Content</div>

5. Combine with Spacing Utilities

Use spacing utilities (u-mb-*, u-pt-*, etc.) for vertical spacing between grid sections:

HTML
1<div class="o-container u-pt-5 u-pb-5"> 2 <div class="o-row"> 3 <div class="o-col-12">Content</div> 4 </div> 5</div>

Common Layout Patterns

Two-Column Layout

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12 o-col-6@md"> 4 <!-- Left column --> 5 </div> 6 <div class="o-col-12 o-col-6@md"> 7 <!-- Right column --> 8 </div> 9 </div> 10</div>

Three-Column Layout

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12 o-col-4@md"> 4 <!-- Column 1 --> 5 </div> 6 <div class="o-col-12 o-col-4@md"> 7 <!-- Column 2 --> 8 </div> 9 <div class="o-col-12 o-col-4@md"> 10 <!-- Column 3 --> 11 </div> 12 </div> 13</div>

Four-Column Layout

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12 o-col-6@md o-col-3@lg"> 4 <!-- Column 1 --> 5 </div> 6 <div class="o-col-12 o-col-6@md o-col-3@lg"> 7 <!-- Column 2 --> 8 </div> 9 <div class="o-col-12 o-col-6@md o-col-3@lg"> 10 <!-- Column 3 --> 11 </div> 12 <div class="o-col-12 o-col-6@md o-col-3@lg"> 13 <!-- Column 4 --> 14 </div> 15 </div> 16</div>

Asymmetric Layout

HTML
1<div class="o-container"> 2 <div class="o-row"> 3 <div class="o-col-12 o-col-8@md"> 4 <!-- Main content (8 columns) --> 5 </div> 6 <div class="o-col-12 o-col-4@md"> 7 <!-- Sidebar (4 columns) --> 8 </div> 9 </div> 10</div>

Grid Variables

When working with SCSS, you can reference grid variables:

SCSS
1// Number of columns 2$grid-columns: 12; 3 4// Gutter width 5$grid-gutter: 42px; 6 7// Calculate column width 8$column-width: (100% / $grid-columns) * $i;

Accessibility Considerations

  • Ensure grid layouts remain readable and functional when content is zoomed or text is resized
  • Test layouts with screen readers to ensure logical content order
  • Maintain semantic HTML structure within grid columns (use appropriate heading levels, landmarks, etc.)
  • Ensure sufficient color contrast and spacing for touch targets on mobile devices

References


By following these grid system guidelines, Cynosure ensures consistent, responsive layouts that work seamlessly across all devices and screen sizes.