Git Product home page Git Product logo

dmnkb / worlds-best-grid Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 287 KB

Das weltbeste Grid (world's best grid) is a mobile-first lightweight and easy-to-use 12 columns responsive grid that covers breakpoints for most of currently common mobile devices. Under the hood it makes use of mdc-layout-grid and include-media.

License: MIT License

JavaScript 11.26% HTML 43.89% SCSS 44.85%
grid mdc-layout-grid custom-breakpoints sass mobile-first responsive lightweight 12-columns

worlds-best-grid's Introduction

World's Best Grid ๐Ÿš

This is a mobile-first lightweight and easy-to-use 12 columns responsive grid that covers breakpoints for most of currently common mobile devices. Under the hood it makes use of mdc-layout-grid and include-media.

Motivation

Most responsive frameworks I used to work with have a couple of things in common: Limited amount of breakpoints (small, medium, large), complex classes (mdc-layout-grid__cell) and an unnecessary overhead.

Solution

Using SASS loops in combination with include-media all breakpoint classes are generated procedurally. Adding new breakpoints is as easy as extending the $breakpoints list.

Example

Say, you want a container to fill 9 / 12 columns when the user is using an iPhone 12:

<div class="grid">
  <div class="inner">
    <div class="col ip12-9">
      Content goes here
    </div>
  </div>
</div>

See? Simple.

Available breakpoints

$breakpoints: (
  small: (
    "size": 0px,
    "class": "s"
  ),
  medium: (
    "size": 640px,
    "class": "m"
   ),
  large: (
    "size": 1024px,
    "class": "l"
  ),
  xlarge: (
    "size": 1200px,
    "class": "xl"
  ),
  xxlarge: (
    "size": 1440px,
    "class": "xxl"
  ),
  iphone5: (
    "size": 320px,
    "class": "ip5"
  ),
  iphonex: (
    "size": 375px,
    "class": "ipx"
  ),
  iphone11: (
    "size": 414px,
    "class": "ip11"
  ),
  iphone12: (
    "size": 390px,
    "class": "ip12"
  ),
  ipad: (
    "size": 810px,
    "class": "ipad"
  ),
  redmi-note-8: (
    "size": 1080px,
    "class": "rn8"
  ),
  galaxy-a51: (
    "size": 1080px,
    "class": "ga51"
  )
);

Custom breakpoints

In order to add custom breakpoints simply clone this project and extend the breakpoint list inside sass/app.scss.

Install

NPM

npm install dasweltbestegrid

Or simply clone the GitHub repository. Then, include the file in your project using an @import statement.

License

This project is licensed under the terms of the MIT license.

worlds-best-grid's People

Contributors

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