Giter VIP home page Giter VIP logo

suitcss-grid's Introduction

SUIT grid

A SUIT component for a CSS grid. The grid makes use of inline-block and box-sizing to provide features that float-based layouts cannot.

N.B. This component relies on particular dimensions being applied to cells in the grid via other classes. For example, SUIT dimensions or the SUIT Grid Layouts extension.

Read more about SUIT's design principles.

Installation

  • Bower: bower install --save suit-grid
  • Download: zip
  • Git: git clone https://github.com/necolas/suit-grid

Features

  • Fluid layout.
  • Intelligent cell wrapping.
  • Horizontal centering of cells.
  • Custom vertical alignment of cells (top, bottom, or middle).
  • Cell width is controlled independently of grid gutter.
  • Infinite nesting.
  • Built-in redundancy.

Use

A simple grid is easy to create. A grid container can have any number of cells. Each cell can be directly or indirectly styled to control their width and alignment.

<div class="Grid">
    <div class="Grid-cell u-size1of2"></div>
    <div class="Grid-cell u-size1of2"></div>
    <div class="Grid-cell u-size1of3"></div>
    <div class="Grid-cell u-size1of3"></div>
</div>

All cells within a grid can be centered by adding the Grid--center class to the grid container:

<div class="Grid Grid--center">
    <div class="Grid-cell u-size1of3"></div>
    <div class="Grid-cell u-size1of3"></div>
</div>

Or individual cells can be centered on their own line by adding the Grid-cell--center class to a cell:

<div class="Grid">
    <div class="Grid-cell u-size1of2"></div>
    <div class="Grid-cell u-size1of2"></div>
    <div class="Grid-cell Grid--center u-size3of4"></div>
</div>

The core grid component includes no gutters by default.

You may want to install or create a skin that adds gutters to the grid. This is the technique used to create gutters:

/* Grid gutters: 10px */

.Grid {
    margin: 0 -5px;
}

.Grid-cell {
    padding: 0 5px;
}

Browser support

  • Google Chrome (latest)
  • Opera (latest)
  • Firefox 4+
  • Safari 5+
  • Internet Explorer 8+

suitcss-grid's People

Contributors

necolas avatar quentind avatar

Watchers

Jared Hanson avatar James Cloos avatar  avatar

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.