Git Product home page Git Product logo

gridly's Introduction

gridly

gridly

Support me on Patreon Buy me a book PayPal Ask me anything Version Downloads Get help on Codementor

Buy Me A Coffee

The minimal (~100-170 bytes) grid system for modern browsers.

You don't need monolithic CSS frameworks for simple grid systems. ~100 bytes of CSS can save your life. πŸ’«

Usage

In the dist directory there are three minified files:

  • gridly-core.min.css (105 B): just the Gridly core including same-width column support and mobile responsive support.
  • gridly-col-widths.min.css (115 B): the custom width columns
  • gridly.min.css (165 B): the previous two files' content put together

If you need to support more browsers, you can use the prefixed versions. They're located in dist/prefixed. They're ~1.8Γ— the size of their counterparts.

Browser Support

Gridly supports browsers that implement the Flexible Box Layout Module.

As of December 2015, browser support for flexbox is 81.27% for unprefixed, and 95.44% for prefixed.

πŸš€ Available on CDN!

Gridly is available on cdnjs.com. Check it out.

https://cdnjs.cloudflare.com/ajax/libs/gridly/1.1.0/gridly-core.min.css https://cdnjs.cloudflare.com/ajax/libs/gridly/1.1.0/gridly-col-widths.min.css https://cdnjs.cloudflare.com/ajax/libs/gridly/1.1.0/gridly.min.css

If you do not need custom width columns, you will probably want to use only gridly-core.min.css in your page. If you do need the custom width columns, you have to include gridly.min.css instead.

Example

Include the CSS file in your page:

<link rel="stylesheet" href="gridly.min.css" type="text/css" charset="utf-8">

Then you can use the .row and .col classes:

<div class="row">
    <div class="col">Two</div>
    <div class="col">Column</div>
</div>

This will create two columns having equal widths.

gridly

☁️ Installation

Check out the dist directory to download the needed files and include them on your page.

If you're using this module in a CommonJS environment, you can install it using npm or yarn and require it:

# Using npm
npm install --save gridly

# Using yarn
yarn add gridly

❓ Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. πŸ›
  3. For direct and quick help, you can use Codementor. πŸš€

πŸ“ Documentation

The gridly-core.min.css file handles two classes:

  • row: the row containing columns
  • col: the column to put in the row

Because of the flexbox amazing power, the columns will have the same width (as many columns you want / row).

To extend this basic functionality, there is another file: gridly-col-widths.min.css. This adds the following classes:

  • col-tenth has 10% width
  • col-fifth has 20% width
  • col-quarter has 25% width
  • col-third has 33.3333334% width
  • col-half has 50% width

Like specified above, the gridly.min.css contains both: the core and the custom widths.

πŸ˜‹ How to contribute

Have an idea? Found a bug? See how to contribute.

πŸ’– Support my projects

I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like πŸš€

  • Buy me a bookβ€”I love books! I will remember you after years if you buy me one. 😁 πŸ“–

  • PayPalβ€”You can make one-time donations via PayPal. I'll probably buy a coffee tea. 🍡

  • Support me on Patreonβ€”Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).

  • Bitcoinβ€”You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6

Thanks! ❀️

Run npm i to install the dependencies. Then, you can run the npm scripts using npm run <script-name>.

Run npm run release to recreate all the dist files.

πŸ’« Where is this library used?

If you are using this library in one of your projects, add it in this list. ✨

  • showalicense.com–A site to provide an easy way to show licenses and their human-readable explanations. (source)

πŸ“œ License

MIT © Ionică Bizău

gridly's People

Contributors

burakcan avatar h-kod avatar ionicabizau avatar khamer avatar opattison avatar phoenixenero avatar silviubogan 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar

gridly's Issues

Add support for IE11 and prefixed settings

While I love the concept of Gridly, using this on client sites has been getting me hollered at for small bugs with IE11. I get we can't support every version of IE, but IE11 touts it supports flexbox. Poorly though.

From my experience I've learned that it doesn't use the default settings of 'flex:1' like the rest of the browsers. So you must be more explicit for it to work properly. Also adding the prefixed versions of the props can't hurt. I did read your 'guidelines' for contributing, but seemed like overkill for a project which literally has two lines of (compressed) CSS.

.row{display:-ms-flexbox;display:-webkit-flex;display:flex;}
.col{-ms-flex-grow:1;-webkit-flex-grow:1;flex-grow:1}

@media(max-width:48em){
.row{-ms-flex-direction: column;-webkit-flex-direction: column;flex-direction:column;}
.col{flex:0 0 auto}
}

Homepage dead links

Noticed the links to the zip downloads on your github.io homepage are dead (at least for me, just now).

Also a question, does Gridly support nesting?

Add CDN support

It will be great you may considerate to add your production file to some CDN server.
Great job!

Demo page has a flexbox height bug in Safari 9.x (OS X, iOS)

2015-12-11 flex-basis bug in Safari – collapsed vertical height

Spotted in Safari OS X 9.0.1 on OS X. On narrower views (below 48em, I believe), the grid collapses vertically, creating a visual bug. This is caused by how Safari handles flex: 0 0 100%. Setting this to flex: 0 0 auto should fix this behavior, but more cross-browser testing is needed since Chrome, Firefox and others may treat this differently (although I believe my fix should work, so do test it out). flex-basis: 100% is the issue here. Note that 100% works for horizontal (row) but fails for vertical (column) flex layouts in Safari. auto (the default value for flex-basis) negates the issue for either flex-direction.

I have run into this issue on multiple other sites. I've looked at the spec and I'm not yet entirely sure whether Safari has it right or wrong.

Let me know if you want more testing or a PR.

Gutters

How can i add a 20px gutter to the columns?
Like the bootstrap one

Docs: Browser Support

would be nice to have a litte more info about which browsers are supported, e.g. which of the old flexbox syntaxes are in and which are not? Thanks!

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.