Giter Club home page Giter Club logo

lightweight-nestable-grid's Introduction

Lightweight Nestable Grid

A lightweight, nestable, mobile first grid.

To use the grid you will need a parent element with a class of grid. Columns are then implemented by using a class equal to the desired percentage width (grid__col--{width}). When nesting, you will need to use the grid class on each grid's parent. For best performance, keep your grid abstracted by using dedicated elements.

Also, and this is important, due to the use of inline-block you will need to comment out the white space between the column elements. This is the most consistent way to deal with this space.

The available widths are:

Width Class
20% .grid__col--20
25% .grid__col--25
30% .grid__col--30
33% .grid__col--33
40% .grid__col--40
50% .grid__col--50
60% .grid__col--60
67% .grid__col--67
70% .grid__col--70
75% .grid__col--75
80% .grid__col--80
100% .grid__col--100

Example markup:

<div class="grid">
	<div class="grid  grid__col--67">
		<div class="grid__col--50">
			…
		</div><!--
	 --><div class="grid__col--50">
			…
		</div>
	</div><!--
 --><div class="grid__col--33">
		…
	</div>
</div>

Live demo: http://codepen.io/joshnh/pen/f2d2f034c97f4d6d89c47955c3b92f8d

Note: make sure that you are using the grid and grid__col--{width} classes on block level elements.

lightweight-nestable-grid's People

Contributors

joshnh avatar

Watchers

James Cloos avatar Stefan Bödenauer 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.