Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Mar 17, 2024. It is now read-only.
/capital-gPublic archive

A simple SASS grid framework with no dependencies

NotificationsYou must be signed in to change notification settings

rossnoble/capital-g

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sass Config

Every project will require the following variable map to be defined:

$g-config: (maxWidth:1020px,tabletWidth:720px,columnPadding:15px,gutter:20px);

Flexibility

There are two ways you can implement a grid in your layout:

  • Via HTML classes
  • Via SASS mixins

Neither is more correct that the other. It all depends on your use case. The CSS route is perhaps cleaner, but may be more work if you have to name addtional components to style.

HTML Method

Column widths and break rules are defined as classes in the HTML.

<divclass="Layout G-container"><divclass="G-row"><divclass="G-col-4 G-col-mobile--12"><!-- content goes here --></div><divclass="G-col-8 G-col-mobile--12"><!-- content goes here --></div></div></div>

CSS Method

Elements are assigned classes in the HTML but the column widths and break rules are defined in the SASS/CSS using mixins.

<divclass="Layout"><divclass="Layout-inner"><divclass="Sidebar"><!-- content goes here --></div><divclass="Content"><!-- content goes here --></div></div></div>
.Layout {@includeg();.Layout-inner {@includeg-row();  }.Sidebar {@includeg-col(4);@includeg-when-mobile {@includeg-col(12);    }  }.Content {@includeg-col(8);@includeg-when-mobile {@includeg-col(12);    }  }}

Reference

SASS Mixins

Container

@includeg($fluid:false, $flush:false, $gutter:true);

Row

@includeg-row();

Column

@includeg-column($columns);

Mobile media query helper

@includeg-when-mobile() {// Styles here}

Desktop media query helper

@includeg-when-tablet() {// Styles here}

Desktop media query helper

@includeg-when-desktop() {// Styles here}

CSS Classes

Container

<divclass="G-container G-container--fluid"><!-- content goes here --></div>

Fluid Container (no max width)

<divclass="G-container G-container--fluid"><!-- content goes here --></div>

Flush Container (no container gutter)

<divclass="G-container G-container--flush"><!-- content goes here --></div>

Guttler Container (no column gutters)

<divclass="G-container G-container--gutterless"><!-- content goes here --></div>

About

A simple SASS grid framework with no dependencies

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp