GithubHelp home page GithubHelp logo

vicompany / ezpz-flexbox-grid Goto Github PK

View Code? Open in Web Editor NEW
14.0 8.0 4.0 1015 KB

A lightweight Sass (.scss) flexbox grid system that's easy to setup and offers a lot of customisation.

Home Page: https://vicompany.github.io/ezpz-flexbox-grid/

License: Other

SCSS 100.00%

ezpz-flexbox-grid's Introduction

EZPZ Flexbox Grid

dependencies npm

A lightweight Sass (.scss) flexbox grid system that's easy to setup and offers a lot of customisation, by VI Company.

Want to see how it works? Check out the demo pages and settings.

Features

  • Easy peasy to setup and use
  • Works in all modern browsers & IE11
  • IE10 when using Autoprefixer
  • Uses BEM syntax for grid classes
  • Many optional features to reduce CSS bloat
  • Define and use fractions
  • Infinite nesting
  • Create and name your own breakpoints
  • Custom namespacing

Documentation

Demo

What about older browsers?

The aim of the EZPZ Flexbox Grid is to offer an easy to use grid system that takes abundant calculations and classes out of your workflow by leveraging flexbox' "awareness" of available space within a section.

Unfortunately, legacy browsers like IE9 and below do not support the flexbox syntax and won't be able to use these properties. To maintain simplicity, reduce code bloat and in the light of Microsoft's decision to stop support for IE10 and below, the decision has been made to not support older browsers.

Contributing

Build

npm install
npm run build

Get in touch

Credits

  • Variable namespacing and the .grid and .cell classes have been inspired by the Avalanche CSS grid system.
  • Multiple cross-browser issues have been resolved through the extremely helpful Flexbugs repository.
  • A guide to Flexbox by Chris Coyier has been a great resource throughout the development of the EZPZ grid.
  • Wes Bos' What the Flexbox which re-ignited my interest in Flexbox.
  • The grid functionality in the example pages has been illustrated through the use of the Ocean Five color pallete by Designjunkee.

License

The EZPZ Flexbox Grid is licensed under the MIT License.

ezpz-flexbox-grid's People

Contributors

ba55ie avatar bas-vi avatar edw1n avatar pimskie avatar sjorsvicompany avatar svensigmond avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ezpz-flexbox-grid's Issues

Vertical layout

I've tried .gid--vertical > .cell.cell--6 + .cell.cell--6 and, well, it's still setting width of the cells. I think it's worth to mention in the docs that you have to specify heights yourself :)

Cheers!

Grid wrapping

Make wrapping the default. My opinion is that grid cells should wrap to a new line when there isn't enough space. Just like all other grid systems.

Also the demo does not seem to work on Firefox.

Grid gutter collapsed not working

Because the grid-gutter-expanded mixin (line 383) is generating the wrong class. It's using &#{$breakpoint}collapsed instead of &#{$breakpoint}expanded.

Use Rawgit for demo

Generate a CSS file in the master branche and use this file, thru RawGit, for the demo (gh-pages branche). This way the demo will always be up to date and we don't need any build scripts in that branche.

Method to override flex-grow for direct children of .cell

The grid has the following rule set in which all direct children of a .cell get the flex-grow property. That can be nice for equal height columns, but it's a problem when you don't want that automagic behaviour.

.grid > .cell > * {
    flex-grow: 1;
}

Also, I'd rather not use the universal selector and the .cell doesn't have to be nested within a .grid. Just using the .cell selector reduces the risk of specificity problems.

Grid class modifier to align items to baseline

The grid has alignment features such as: .grid--align-start and .grid--align-end. An extra class (f.e. .grid--align-baseline) to align items to the baseline would be a welcome enhancement.

Offset

The normal (non breakpoint) classes for offset are not generated by the grid.

.cell--offset-1/4 is not availble but .cell--offset-small-1/4 is.

Mixins

Hello
Nice grid system - however, I was wondering whether you're planning to add some mixins so the grid systems could be used in a more unobtrusive way.

Thanks

When using the collapsed mode, `.grid` should not have margin

When using .grid--collapsed the child .cells have no padding, which is correct. However, the .grid parent still has negative margins to compensate for the padding. This seems incorrect, as the grid is now aligned incorrectly too far to the left/right sides of the screen.

Proposed solution, add:

.grid--collapsed {
	margin-right: 0;
	margin-left: 0;
}

Could be placed after line 426:

https://github.com/vicompany/ezpz-flexbox-grid/blob/master/lib/_ezpz-flexbox-grid.scss#L426

Breaking Change: Slash as Division

See article: https://sass-lang.com/documentation/breaking-changes/slash-div

Sass currently treats / as a division operation in some contexts and a separator in others. This makes it difficult for Sass users to tell what any given / will mean, and makes it hard to work with new CSS features that use / as a separator.

To ease the transition, Sass has begun by adding the math.div() function. The / operator still does division for now, but it also prints a deprecation warning when it does so. Users should switch all division to use math.div() instead.

There are 5 instances where the / is used as a division operation in version 4.0.0 of the ezpz-flexbox-grid system according to my Dart-Sass compiler:

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($ezpz-gutter, 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
474 │     margin-right: -($ezpz-gutter / 2);
    │                     ^^^^^^^^^^^^^^^^
    ╵
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 474:18  create-grid()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 494:2   generate-full-grid()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 541:3   base()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 593:2   @import
    src/scss/main.scss 23:9                                    root stylesheet
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($ezpz-gutter, 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
475 │     margin-left: -($ezpz-gutter / 2);
    │                    ^^^^^^^^^^^^^^^^
    ╵
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 475:17  create-grid()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 494:2   generate-full-grid()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 541:3   base()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 593:2   @import
    src/scss/main.scss 23:9                                    root stylesheet
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($ezpz-gutter, 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
490 │     padding: 0 ($ezpz-gutter / 2);
    │                 ^^^^^^^^^^^^^^^^
    ╵
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 490:14  create-grid-cell()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 497:3   generate-full-grid()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 541:3   base()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 593:2   @import
    src/scss/main.scss 23:9                                    root stylesheet
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($key, $val)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
75 │                 @include create-cell($key / $val);
   │                                      ^^^^^^^^^^^
   ╵
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 75:26  create-cells()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 60:2   generate-all-cells()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 543:3  base()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 593:2  @import
    src/scss/main.scss 23:9                                   root stylesheet
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($key, $val)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
271 │                 @include cell-offset($key / $val);
    │                                      ^^^^^^^^^^^
    ╵
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 271:26  cell-fraction-offset()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 252:2   generate-cell-offset()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 563:5   base()
    node_modules/ezpz-grid/lib/_ezpz-flexbox-grid.scss 593:2   @import
    src/scss/main.scss 23:9                                    root stylesheet

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.