Skip to content

mattweb/flx-grid.scss

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

flx-grid.scss

A small flexbox based grid system.

Requirements

  • Sass 3.4

Quick Start Guide

#####Default values:

  • 12 comluns per container
  • 10px margin

Container

Include the flx-container mixin to your container element. Notice that, because of the nature of flexbox, every element that shall contain grid-elements, requires flx-container.

.container {
	@include flx-container;
}

Compiled CSS:

.container {
  display: flex;
  flex-wrap: wrap;
  box-sizing: border-box;
  flex-direction: row;
  direction: ltr;
}

Item

Add flx-item to any element to define the number of columns it should span.

.item {
	@include flx-item(3);
}

Compiled CSS:

.item {
  flex-basis: -webkit-calc(25% - 7.5px);
  flex-basis: calc(25% - 7.5px);
  margin: 0 10px 10px 0;
}

Last

The last item in each row needs flx-last to reset the spacing margin.

.element.last {
	@include flx-last;
}

Compiled CSS:

.item.last {
  margin-right: 0;
}

About

A small flexbox based grid system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 100.0%