Giter VIP home page Giter VIP logo

fishtank-grid's Introduction

Fishtank Grid

Installation

npm install @fishtank/grid

Dev Environment Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

Grid Build and Test

# lint SCSS
npm run test

# build uncompressed grid 
npm run build:css

# build grid for production with minification
npm run build

Usage

The Fishtank grid comes in 2 versions, flexbox and css display:grid. Flexbox has wider adoption, and is a safe choice for projects that require wider browser compatibility. As of June 2018, The display:grid version has fairly high adoption with modern browers, but is not recommended for projects that need to support IE10 and earlier or Chrome 57 and earlier. Please consult caniuse.com to check adoption.

Container

The "ft-container" class sets the main container width, across responsive breakpoints. These are fixed widths with minimum breakpoints at 1440px, 1008px, and 752px (desktop down to tablet vertical sizes). Below 752px the grid becomes fluid, and is set the max width of the vuewport size.

<div class="ft-container">

By adding the "ft-fluid" class to same element, the container becomes fluid through all breakpoints

<div class="ft-container ft-fluid">

Flexbox Grid

The Flexbox grid provides a 12 column layout to provive layout and alignment of content. Add "ft-row-flex" to start your flexbox row container. Use the notation of "ft-col-[breakpoint size][number of columns] to define the number of colums of the cell occupies.

<div class="ft-container">
  <div class="ft-row-flex">
    <div class="ft-col-xs6"></div>
  </div>
</div>

Display:Grid

CSS Display:grid offers the opportunity to use a grid system designed natively for the browser. However, to support the overall Fishtank grid and spacing guidelines, we have implement a series of utility class names for row and column alignments up to a 12 column grid.

Add "row-dgrid" to start your display:grid row container. Add the "ft-col-fixed-[Number of columns]" class name to element to define the number of columns displayed per row. Display:grid will automatically display the cells at the correct % width to display that number of cells per row. It will continue to flow the cells into multiple rows, maintaining the same cell width.

<div class="ft-row-dgrid ft-col-fixed-4"></div>

The responsive column pattern functions similarly to the flexbox grid.

<div class="ft-row-dgrid">
  <div class="ft-col-xs12 ft-col-sm6 ft-col-md8 ft-col-lg3"></div>
  <div class="ft-col-xs12 ft-col-sm6 ft-col-md4 ft-col-lg9"></div>
</div>

There are also offset utility classes.

<div class="ft-row-dgrid">
  <div class="ft-col-offset-start-xs2 ft-col-offset-end-xs5"></div>
  <div class="ft-col-offset-start-xs9 ft-col-offset-end-xs13"></div>
</div>

[TODO: Flexbox alignment and order class names; Display:grid template layouts]

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.