Skip to content

Commit

Permalink
Add initial version of layout bottom gutters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenad Jelovac committed Aug 24, 2014
1 parent 25ddc36 commit 6c0eb4f
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bower_components/
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
inuit-layout-bottom-gutters
===========================
# Layout items with bottom gutter.

An extension of inuitcss layout object that adds bottom gutter to layout items.
An extension of [inuitcss' layout object](https://github.com/inuitcss/objects.layout) that adds bottom gutter to layout items.
148 changes: 148 additions & 0 deletions _objects.layout-botom-gutters.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/*------------------------------------*\
#LAYOUT-BOTTOM-GUTTERS
\*------------------------------------*/

/**
* This extension uses an `:after` pseudo element with negative top margin
* applied to `.layout` object to negate layout items bottom margin.
*/

/**
* Default layout.
*
* 1. Make sure `:after` pseudo element takes the whole width of its parent.
* 2. Negate layout item's bottom margin.
*/
.#{$inuit-layout-namespace}layout,
%#{$inuit-layout-namespace}layout {

&:after {
content: "";
display: block; /* [1] */
margin-top: -($inuit-layout-gutter); /* [2] */
}

}

.#{$inuit-layout-namespace}layout__item,
%#{$inuit-layout-namespace}layout__item {
margin-bottom: $inuit-layout-gutter;
}





@if ($inuit-enable-layout--tiny == true) {

/**
* Layouts with tiny gutters.
*/

.#{$inuit-layout-namespace}layout--tiny,
%#{$inuit-layout-namespace}layout--tiny {

&:after {
margin-top: -($inuit-layout-gutter--tiny);
}

> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
margin-bottom: $inuit-layout-gutter--tiny;
}

}

}

@if ($inuit-enable-layout--small == true) {

/**
* Layouts with small gutters.
*/

.#{$inuit-layout-namespace}layout--small,
%#{$inuit-layout-namespace}layout--small {

&:after {
margin-top: -($inuit-layout-gutter--small);
}

> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
margin-bottom: $inuit-layout-gutter--small;
}

}

}

@if ($inuit-enable-layout--large == true) {

/**
* Layouts with large gutters.
*/

.#{$inuit-layout-namespace}layout--large,
%#{$inuit-layout-namespace}layout--large {

&:after {
margin-top: -($inuit-layout-gutter--large);
}

> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
margin-bottom: $inuit-layout-gutter--large;
}

}

}

@if ($inuit-enable-layout--huge == true) {

/**
* Layouts with huge gutters.
*/

.#{$inuit-layout-namespace}layout--huge,
%#{$inuit-layout-namespace}layout--huge {

&:after {
margin-top: -($inuit-layout-gutter--huge);
}

> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
margin-bottom: $inuit-layout-gutter--huge;
}

}

}





@if ($inuit-enable-layout--flush == true) {

/**
* Layouts with no gutters.
*/

.#{$inuit-layout-namespace}layout--flush,
%#{$inuit-layout-namespace}layout--flush {

&:after {
margin-top: 0;
}

> .#{$inuit-layout-namespace}layout__item,
> %#{$inuit-layout-namespace}layout__item {
margin-bottom: 0;
}

}

}
23 changes: 23 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "inuit-layout-bottom-gutters",
"version": "0.1.0",
"homepage": "https://github.com/nenadjelovac/inuit-layout-bottom-gutters",
"authors": [
"Nenad Jelovac <[email protected]>"
],
"description": "An extension of inuit-layout that adds bottom gutter to layout items.",
"main": "_objects.layout-bottom-gutters.scss",
"keywords": [
"inuit",
"oocss",
"css",
"framework",
"extension"
],
"license": "Apache",
"dependencies": {
"inuit-defaults": "~0.2.1",
"inuit-mixins": "~0.2.3",
"inuit-layout": "~0.3.2"
}
}

0 comments on commit 6c0eb4f

Please sign in to comment.