Git Product home page Git Product logo

lean-grid's Introduction

About

  • Super lean CSS grid system based on floats
  • Strong cross browser support
  • Tested on IE9+, floats work as far back as IE6, but you still need media queries to make the grid responsive
  • This is not meant to replace CSS Grid/Flexbox, but rather offer a solution for rapidly developing responsive layouts when support for older browsers is required

Working demo


SCSS setup

$columns: 12;
.row:after{
    content: "";
    display: block;
    clear: both;
}
@mixin generate-spans($device-size){
    @for $i from 1 through $columns{
        .span-#{$i}-#{$device-size}{
            width: 100% / $columns * $i;
            float: left;
        }
    }
}

//mobile
@media (max-width: 640px){
    @include generate-spans(s);
}
//tablet
@media (min-width: 640px){
    @include generate-spans(m);
}
//desktop
@media (min-width: 1024px){
    @include generate-spans(l);
}

HTML example usage

<div class="row">
	<div class="span-6-s span-4-m span-4-l">

	</div>
	<div class="span-6-s span-4-m span-4-l">

	</div>
	<div class="span-6-s span-4-m span-4-l">

	</div>
</div>

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.