Skip to content

A lightweight SASS grid built using BEM, OOCSS and a lot of love ❤

Notifications You must be signed in to change notification settings

dgopsq/grdd.css

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grdd.css

A lightweight SASS grid built using BEMIT (by Harry Roberts), OOCSS and a lot of love ❤

Disclaimer

I built this grid just for fun, I know there are many others (maybe too many) which are better than grdd.

Specs

  • grdd weights 1.823 bytes with one breakpoint
  • grdd uses inline-block just because it is fully supported from any browser
  • grdd has 6 columns
  • grdd uses fractions: .grdd__item--1/2
  • grdd uses @ for breakpoints: .grdd__item--1/1@sm
  • grdd is infinitely nestable
  • grdd respects the BEM naming convention
  • grdd respects the OOCSS philosophy
  • grdd is only 60 lines of SASS, including comments and extra spaces

Features

You can customize grdd by changing the variables in the top lines and recompiling it. grdd uses Gulp, so the only thing you have to do in order to recompile it is:

$ cd grdd.css/
$ npm i
$ gulp compile

Namespaces

grdd is a component, so, following the conventions of BEMIT we should append a .c- to the selector, however, you can change that prefix or even delete it.

$grdd-namespace: "whatever-"; // Whatever namespace
$grdd-namespace: "";          // No namespace

Gutter

The default gutter between columns is .625em.

$grdd-gutter: 0; // No gutter

Sizes

You probably don't want the default sizes (.grdd__item--1/2, ...) because you already have a list of sizes in your own project. Turning $grdd-sizes to false allows you to have just the grdd component without all the fractions, thus saving a lot of space.

$grdd-sizes: false; // No fractions

Breakpoints

You can easily add and remove breakpoints but remember that the more breakpoints you add, the more grdd will weight.

$grdd-breakpoints: ( 
  "sm": 48em,
  "lg": 75em
);

Usage

grdd is simple to use!

<div class="c-grdd">
  <div class="c-grdd__item c-grdd__item--1/2 c-grdd__item--1/1@sm"></div><!--
  --><div class="c-grdd__item c-grdd__item--1/2 c-grdd__item--1/1@sm"></div>
</div>

This grid has two 50% columns by default, and two 100% columns when the viewport is < 48em. Remember to add a comment from the end of each grid__item to the start of the next one, this is because grdd uses inline-block.

License

The MIT License (MIT)

Copyright (c) 2016 Diego Pasquali

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A lightweight SASS grid built using BEM, OOCSS and a lot of love ❤

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published