Git Product home page Git Product logo

kayzen-gs's Introduction

GitHub license Travis build npm version

A powerful framework for building responsive grid systems for the web

Installation | Documentation | Demos

Overview

View SassDoc Documentation

Some of the core features of Kayzen-GS include:

Why use inline-block columns?

The simple answer is; flexibility. By definition, columns are just inline blocks - it's the way CSS columns are supposed to work. Creating CSS columns by applying inline-block opens up a whole world of flexibility for your columns - the most useful benefit being the ability to set their horizontal and vertical alignment, just by setting the text-align and vertical-align properties respectively.

Why don't other grid systems use inline-block?

By default, using inline-block for columns causes a natural whitespace to appear between each column, which can vary in width from font to font and browser to browser. This has caused many people many problems, and there are plenty of go-to hacky and impractical work arounds, none of which are really suitble for a production environment. Kayzen-GS allows for the use of completely usable and functional columns which use inline-block and have no white-space. Kayzen-GS works in all browsers, including Internet Explorer 6 (not that anyone uses it anymore...).

Documentation

Default Kayzen Grid System

The below examples are based off the default configuration values.

React
<Row>
    ...
</Row>
HTML
<div class="row">
    ...
</div>

Change the class name row to whatever you want in the Configuration.

Create a Column with no specified width:

React
<Column>Column</Column>
HTML
<div class="span">Column</div>

Change the class name span to whatever you want in the Configuration.

By default, Kayzen-GS comes with reusable classes which can be used to create your column widths. The most basic example of a row of Kayzen columns using the default settings would look something like this:

HTML

<div class="row">                    
    <div class="span-4">span-4</div>
    <div class="span-4">span-4</div>
    <div class="span-4">span-4</div>
</div>
React
<Row>
    <Column width={4}>span-4</Column>
    <Column width={4}>span-4</Column>
    <Column width={4}>span-4</Column>
</Row>

View Demo

Based off the default number of columns (12), the above code would produce 3 columns, each 4/12's (or 1/3) of the total width of the row.

<div class="row">                    
    <div class="span-3">Sidebar</div>
    <div class="span-9">Article</div>
</div>

Likewise, the above code would produce 2 columns; one with a width of 3/12's (or 1/4) and one with a width of 9/12's (or 3/4).

Using these normal columns, the total span of the columns in a given row may not exceed the number of columns the framework has (12 by default) - for such usage, see Flow Columns.

Solving the Whitespace Issue

The issue itself is outlined in great detail in this blog post from the Pure CSS blog. Indeed, this issue is what caused Pure to move away from inline-block columns and towards flexbox. In the Github issue, amongst some interesting proposed fixes included hard-coding the font-family of your row to Arial so the letter-spacing hack would work consistently. However, this, along with all the other hacky fixes were deemed unsuitable for productional use, so thus the decision to leave inline-block was made.

And it isn't only Yahoo's Pure who have experienced this issue; other great frameworks like csswizardry-grids also suffer the same problem.

There is actually a simple way to ignore the whitespace in Webkit based browsers, and that is by adding these two CSS properties to your row element:

display: table;
width: 100%;

With this CSS, you can get inline-block columns to behave exactly as desired in Webkit browsers.

The problem is only really an issue in Webkit based browsers - the letter-spacing fix actually works just fine in Firefox and Internet Explorer without having to hard code any typeface. With these combined, our row mixin looks like this:

@mixin kgs-row-core {
    // Firefox/IE collapse white-space
    letter-spacing: -1em;
    // Webkit collapse white-space
    display: table;
    width: 100%;

    // Opera collapse white-space
    @at-root {
        .opera-only :-o-prefocus, & {
            word-spacing: -0.43em;
        }
    }

    // IE < 8 collapse white-space
    @if kgs-setting('old-ie') {
        *letter-spacing: normal;
        *word-spacing: -0.43em;
    }
} // row()

This mixin allows you to create column rows using the inline-block CSS property for your columns without having to worry about the whitespace that is naturally caused.

Help, Support & Contributing

For all issues, bugs, suggestions and feature requests, please use the issues page.

Follow @esr360 on Twitter!

Changelog

Version 2.5.1

Released: 4th July 2018 πŸ‡ΊπŸ‡Έ πŸ¦…

Release Notes
  • Fixes incorrect externals in webppack config

Version 2.5.0

Released: 14th April 2018

Release Notes
  • Render Rows and Columns with React
  • Updating build tools from Grunt to NPM Scripts
  • Deprecating Bower Support
  • Renaming NPM package from Kayzen-GS to kayzen-gs

Version 2.4.0

Released: 1st June 2017

Release Notes
  • dependencies are now node modules instead of git submodules
  • slight change in how grid system is imported/included
  • scss files linted

kayzen-gs's People

Contributors

esr360 avatar omgmog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kayzen-gs's Issues

How "stack" reacts in own grid systems?

@include column((
    'width'        : 'full', 
    'type'         : null, 
    'stack'        : kgs-option('col-break'), 
    'mobile-first' : kgs-setting('mobile-first'),
    'respond-to'   : null
))

'stack':
This value determines at which breakpoint your columns should stack on top of each other when scaling down. The default value is based off the default value of the main grid system, which evaluates to break-3, which by default evaluates to 940px.

Isn't "row" the element that should has the "stack" value not the "column", like this example:

<div class="row stack-break-2">                    
    <div class="span-3">Sidebar</div>
    <div class="span-9">Article</div>
</div>

I know they are two different cases but isn't it should be the same concept?

Thanks for your amazing work.

Multiple col-12 in one row

If I have multiple col-12 in one row (see example), the second col-12 got a margin-right which is not needed on col-12.

Example:

<div class="container">
   <div class="row">
      <div class="col-12 vertical-middle">
         <svg class="footer__icon">
            <use xlink:href="#logo-bear"></use>
         </svg>

         <h1>XXX</h1>
         <p>XXX</p>
      </div>

      <div class="footer__bottom col-12 text-center">
         <p>Copyright &copy; 2015</p>
      </div>
   </div>
</div>

Behavior of vertical alignment

I have some weird behavior going on with vertical alignment of two columns. I want the first column to be in the middle of the whole container/row and the second column to be at the bottom but this won't work somehow (see Screenshot in Attachment).

NOTE: The .row and .container both have a height of 100% in CSS, so they fill up the whole screen. The page itself uses fullPage.js, that's why I needed that height.

HTML:

<div class="container">
   <div class="row">
      <div class="vertical-middle col-12">
         <h1>Hello World</h1>
      </div>

      <div class="vertical-bottom col-12">
         <h1>Hello World</h1>
      </div>
   </div>
</div>

screenshot-localhost 8000 2015-09-11 11-13-44

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.