All Projects → gotbahn → flex-box-grid

gotbahn / flex-box-grid

Licence: MIT license
Responsive, mobile first Flexbox Grid

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to flex-box-grid

gridbugs-ru
Перевод списка багов в CSS Grid Layout, курируемого Рейчел Эндрю
Stars: ✭ 27 (-30.77%)
Mutual labels:  grid, grid-layout
60gs
60GS - 60 Columns Grid System based on CSS Grid Layout
Stars: ✭ 65 (+66.67%)
Mutual labels:  grid, grid-layout
Flex Grid Lite
Lightweight column grid with the power of flexbox
Stars: ✭ 116 (+197.44%)
Mutual labels:  grid, flexbox-grid
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (+143.59%)
Mutual labels:  grid, flexbox-grid
Reactsimpleflexgrid
A way to quickly add a Grid Layout to your React app 🚀
Stars: ✭ 181 (+364.1%)
Mutual labels:  grid, grid-layout
React Photo Layout Editor
Photo layout editor for react
Stars: ✭ 96 (+146.15%)
Mutual labels:  grid, grid-layout
Popo
PoPo is the grid layout tool, the best choice for runtime layout.
Stars: ✭ 130 (+233.33%)
Mutual labels:  grid, grid-layout
Interior
Design system for the modern web.
Stars: ✭ 77 (+97.44%)
Mutual labels:  grid, grid-layout
Angular Grid Layout
Responsive grid with draggable and resizable items for Angular applications.
Stars: ✭ 163 (+317.95%)
Mutual labels:  grid, grid-layout
React Awesome Styled Grid
A responsive 8-point grid system layout for React using styled-components
Stars: ✭ 157 (+302.56%)
Mutual labels:  grid, grid-layout
Gridlex
Just a CSS Flexbox Grid System
Stars: ✭ 1,328 (+3305.13%)
Mutual labels:  grid, flexbox-grid
Magic Grid
A simple, lightweight Javascript library for dynamic grid layouts.
Stars: ✭ 2,827 (+7148.72%)
Mutual labels:  grid, grid-layout
React Rasta
React Rasta is a powerful and flexible grid system for React
Stars: ✭ 88 (+125.64%)
Mutual labels:  grid, grid-layout
grid-container
A grid for the future, CSS Grid Layout + Web Components (Custom Elements v1 + Shadow DOM v1)
Stars: ✭ 51 (+30.77%)
Mutual labels:  grid, grid-layout
Grid Cheatsheet
CSS Grid cheat sheet
Stars: ✭ 83 (+112.82%)
Mutual labels:  grid, grid-layout
Bootstrap Grid Css
The grid and responsive utilities classes extracted from the Bootstrap 4 framework, compiled into CSS.
Stars: ✭ 119 (+205.13%)
Mutual labels:  grid, grid-layout
Atgrid.css
CSS Grid System with attribute selectors
Stars: ✭ 37 (-5.13%)
Mutual labels:  grid, flexbox-grid
React Native Grid List
🌁 Grid list component implemented with FlatList
Stars: ✭ 74 (+89.74%)
Mutual labels:  grid, grid-layout
Flexible Grid
Flexible grid layouts to get you familiar with building within the flexible grid system.(HTML, CSS, SASS, SCSS)
Stars: ✭ 154 (+294.87%)
Mutual labels:  grid, flexbox-grid
Grd
A CSS grid framework using Flexbox. Only 321 bytes (Gzipped).
Stars: ✭ 2,210 (+5566.67%)
Mutual labels:  grid, grid-layout

▥ Flex Box Grid

npm Build Status David npm npm

Responsive, mobile first Flexbox Grid

Installation

via npm

npm install flex-box-grid

and use CSS or Sass version from node_modules/flex-box-grid folder

Manual

with CSS

Download css and include inside <head> section.

with Sass

Download flexboxgrid.zip. Extract it to Sass working directory

Demo & Documentation

Demo and most detailed documentation you can find here "Flex Box Grid Demo & Documentation").

Basic

Flex Box Grid systems are used for creating page layouts through a series of rows and columns that house your content. By default Flex Box Grid have 12 columns.

  • Rows must be placed within a .container with predefined paddings that equal half column gutter.
  • Use rows .row to create horizontal groups of columns.
  • Content should be placed within columns with classes .X-n, .S-n, .M-n, .L-n, .XL-n where n is columns number from 1 to 12 (by default).
  • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .row, by default it's 10px.

MobileLaptop

<div class="container">
    <div class="row">
        <div class="M1">...</div> * 12
        <div class="M8">...</div><div class="M4">...</div>
        <div class="M6">...</div><div class="M6">...</div>
        <div class="M4">...</div> * 3
    </div>
</div>

Media Queries

Media queries is a basis of any Responsive Grid System. To change column behavior each media query breakpoint connected with column class name with simply recognizing size name: X, S, M, L, XL.

As example column with .M6 class will be halfwidth until the window width becomes equal to 768px or less matching $screen--M.

Areas

Predefined break points:

$break--S:  480px;
$break--M:  768px;
$break--L:  1024px;
$break--XL: 1440px;

To change column content behavior...

<div class="container">
    <div class="row">
        <div class="M6">
            <div class="foo">...</div>
        </div>
    </div>
</div>

...use appropriate media query

@media (min-width: $screen--M) {
    .foo {
        ...
    }
}

Mixing columns

Wanna different behavior on multiple devices? Try to mix columns.

MobileLaptop

<div class="container">
    <div class="row">
        <div class="M4 L8">...</div>
        <div class="M8 L4">...</div>
    </div>
    <div class="row">
        <div class="M6 L4">...</div>
        <div class="M6 L4">...</div>
        <div class="M12 L4">...</div>
    </div>
</div>

You can mix any number of different grid classes

Nesting columns

Grid columns can be nested one into another.

MobileLaptop

<div class="container">
    <div class="row">
        <div class="M8">
            <div class="row">
                <div class="M6">...</div>
                <div class="M6">...</div>
            </div>
        </div>
        <div class="M4">
            <div class="row">
                <div class="M4">...</div>
                <div class="M4">...</div>
                <div class="M4">...</div>
            </div>
        </div>
    </div>
</div>

Offseting columns

Move columns right using --offsetN suffix on grid classes. These will increase left indent of a column. As example .M--offset2 moves .M6 block over 2 columns.

MobileLaptop

<div class="container">
    <div class="row">
        <div class="M6 M--offset1">...</div>
        <div class="M5">...</div>
    </div>
    <div class="row">
        <div class="M6 M--offset2">...</div>
    </div>
    <div class="row">
        <div class="M4">...</div>
        <div class="M4 M--offset4">...</div>
    </div>
</div>

Reordering columns

Grid columns order can be changed in any way with --orderN suffix. You can change swap blocks position on different devices. No need to duplicate blocks anymore.

MobileLaptop

<div class="container">
    <div class="row">
        <div class="M3 X--order4">...</div>
        <div class="M3 X--order1">...</div>
        <div class="M3 X--order2">...</div>
        <div class="M3 X--order3">...</div>
    </div>
    <div class="row">
        <div class="M6 M--order6">...</div>
        <div class="M3 M--order6">...</div>
    </div>
</div>

Reversing columns

Well, hard to say what for, but columns can be also reversed with N--reverse

MobileLaptop

<div class="container">
    <div class="row X--reverse">
        <div class="M1">1</div>
        <div class="M1">2</div>
        <div class="M1">3</div>
        <div class="M1">4</div>
        <div class="M1">5</div>
        <div class="M1">6</div>
        <div class="M1">7</div>
        <div class="M1">8</div>
        <div class="M1">9</div>
        <div class="M1">10</div>
        <div class="M1">11</div>
        <div class="M1">12</div>
    </div>
</div>

Aligning columns

Horizontal

There is predefined classes for horizontal alignment with --start, --center, --end.

MobileLaptop

<div class="container">
    <div class="row X--start">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
    <div class="row X--center">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
    <div class="row X--end">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
</div>

Vertical

There is also predefined classes for vertical alignment with --top, --middle, --bottom. Also you can do full height stretch with N--stretch.

MobileLaptop

<div class="container">
    <div class="row X--top">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
    <div class="row X--middle">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
    <div class="row X--bottom">
        <div class="X3">...</div>
        <div class="X3">...</div>
    </div>
    <div class="row X--stretch">
        <div class="X6">...</div>
        <div class="X6">...</div>
    </div>
</div>

Distribution column space

Between

Another helpful feature can be distribution columns space between or around columns.

MobileLaptop

<div class="container">
    <div class="row X--between">
        <div class="X2">...</div>
        <div class="X2">...</div>
        <div class="X2">...</div>
        <div class="X2">...</div>
    </div>
</div>

Around

MobileLaptop

<div class="container">
    <div class="row X--around">
        <div class="X2">...</div>
        <div class="X2">...</div>
        <div class="X2">...</div>
        <div class="X2">...</div>
    </div>
</div>

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
iOS Safari
iOS Safari
Opera Mini
Opera Mini
Chrome for Android
Chrome for Android
IE10, IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions last 2 versions

FAQ

What is Grid?

The vast majority of websites out there use a grid. They may not explicitly have a grid system in place, but if they have a "main content area" floated to the left a "sidebar" floated to the right, it's a simple grid.

Why use Grid at all?

Using grid system can significant speed up your work, keep you code understandable, solid and DRY.

Why use Flexbox Grid System (FGS) instead float one?

Simply. It's more flexible :) FGS provides you not only the same functionality as float one, it allows significant expand Grid functionality with sorting, reordering, aligning and distribution features.

Concerns?

If you can't say, "Screw IE9" you probably not ready for Flexboxes model in general yet. Also at the moment FGS should contain vendor prefixes -ms- for IE10 and -webkit- for Safari, which increase little bit styles size.

Why use Flex Box Grid? What alternatives are exist?

I tried to use Foundation Grid by Zurb, Flexbox Grid by Kristofer Joseph, Solved by Flexbox by Philip Walton and others. All of them not bad, but in my opinion too complicated for first meet, have specific namespaces and have not full features that Flexboxes model provides.

Flex Box Grid uses simple object oriented name spacing, provides ease customization via Sass variables and have full list of Flexbox features.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].