Git Product home page Git Product logo

grdd.css's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.