Code Monkey home page Code Monkey logo

griddle's Introduction

Griddle

Griddle is a CSS grid system for modern browsers. It is generated from a set of Sass functions and mixins. The grid uses inline-block and box-sizing to provide features that float-based layouts cannot.

Project page

Contribution guidelines

Features

  • Fluid layout.
  • Fluid offsets.
  • 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 coupled with automatic consolidation of rules in compiled CSS.
  • Suitable for responsive layouts. Generate styles (tied to HTML classes) to modify cell proportions at different breakpoints.
  • RTL support.

How to use it

The grid system is suitable whether or not you choose to develop "mobile first". Import grid-helpers and grid-core in order to "initialize" the grid at a given breakpoint.

The grid-build-units() mixin handles the generation of styles for grids. It can accept a space-separated list of integers, each of which results in the creation of a grid with that many parts. For example:

// example-mobile.scss (for min-width >= 30em)
@import "grid-helpers";
@import "grid-core";
// create 2, 3, and 4 column grids
@include grid-build-units(2 3 4);

For any subsequent breakpoints specified in separate files, import grid-helpers to have access to the grid-build-units() mixin. The mixin also accepts a string as a second (optional) argument. This can be used to generate modified selectors to override the width of a cell at different breakpoints. For example:

// example-desktop.scss (for min-width >= 40em)
@import "grid-helpers";
// create 2, 3, 4, 5, 6, and 12 column grids (wider screens)
@include grid-build-units(2 3 4 5 6 12, '--desktop');

You can have a cell that is 50% wide at narrow viewports, but 25% wide at wider viewports when the styles are applied to the modifier class: (<div class="grid__cell unit-1-2 unit-1-4--desktop>).

Feel free to customize the default class name pattern to suit your personal preferences.

Browser support

  • Google Chrome
  • Firefox
  • Safari
  • Opera
  • Internet Explorer 8+

License

Public domain

griddle's People

Contributors

necolas 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.