Coder Social home page Coder Social logo

gridle's Introduction

gridle (v1.3.31)

One grid system to rule them all (.scss)

Gridle is a set of complete and simple settings, mixins and classes that make the creation and usage of grid systems (even complex ones) really simple. All of this with full responsive capabilities

Visit Website for full documentation

Quick start

Importing gridle

import "gridle/gridle"

Configure your grid :

@include gridle_setup( (
	context : 12,
	gutter-width : 20px,
	direction : rtl,
	// etc...
) );

Register states (media queries) (optional) :

@include gridle_register_state ( mobile , (
	max-width : 480px 
) );
@include gridle_register_state ( tablet , (
	min-width : 481px,
	max-width : 1024px
) ) ;

// even with full custom queries :
@include gridle_register_state ( landscape, (
	query : "(orientation : landscape)"
) );

Generate all classes :

@include gridle_generate_classes();

Use your grid in hrml :

<div class="container">
	<div class="grid-12 hide-print">
		Header
	</div>
	<div class="grid-8 grid-mobile-12">
		Content
	</div>
	<div class="grid-4 grid-mobile-12 hide-print">
		Sidebar
	</div>
</div>

Or with mixins :

.container {
	@include gridle_container();
	max-width:960px;
	margin:0 auto;
}
#header {
	@include gridle(12);
}
#sidebar {
	@include gridle(8);
	@include gridle(12,  mobile );
}
#sidebar {
	@include gridle(4);
	@include gridle_hide( mobile );
}
@footer {
	@include gridle(12);
}

Customize your content look and feel with Gridle mixins

#sidebar {
	background : red;

	@include gridle_state(mobile) {
		background : green;
	}
}

Generate custom classes

Gridle allows you to generate custom classes that will be available for each of your states. Here's an exemple

@include gridle_generate_custom_class( ( 'center', '-', '%state' ) ) {
	text-align : center;
}

This will produce the classes : center, center-mobile, center-tablet and center-landscape automatically

More control with Gridle{.js}

Gridle{.js} allows you to be notified when states changes. It find automatically your states registered in your sass. Simple but powerful

Gridle.on('update', function(updatedStates, activeStates, unactiveStates) {
	// do something here...
});
// see documentation for more informations...

gridle's People

Contributors

olivierbossel avatar spaceribs avatar

Watchers

 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.