2.2.1 • Published 9 years ago

enb-bem-grid v2.2.1

Weekly downloads
6
License
-
Repository
-
Last release
9 years ago

bem-grid

Join the chat at https://gitter.im/bem-incubator/bem-grid

Build Status

BEM methodology for Lost Grid.

Usage

Like Twitter Bootstrap:

  1. bower install --save bem-grid
  2. <link rel="stylesheet" href="./bower_components/bem-grid/dist/bem-grid.css">

As ENB module:

  1. npm i --save-dev enb-bem-grid
  2. Add enb-bem-grid after any css builder
[require('enb-bem-grid'), {
    config : {
        maxWidth : '1100px',
        gutter : '10px',
        flex : 'flex'
    }
}]

Example config file ENB with postcss builder.

Easy example

<div class="row">
    <div class="row__col row__col_mw_6">left column</div>
    <div class="row__col row__col_mw_6">right column</div>
</div>
// bemjson
{
    block : 'row',
    content : [
        {
            elem : 'col',
            mods : { mw : 6 },
            content : 'left column'
        },
        {
            elem : 'col',
            mods : { mw : 6 },
            content : 'right column'
        }
    ]
}

Row

Useful mods for row block:

  • (s|m|l|xl|xxl)al - align cols to left on needed displays
  • (s|m|l|xl|xxl)ac - align cols to center on needed displays
  • (s|m|l|xl|xxl)ar - align cols to right on needed displays

  • (s|m|l|xl|xxl)vat - align cols vertically to top on needed displays

  • (s|m|l|xl|xxl)vam - align cols vertically to middle on needed displays
  • (s|m|l|xl|xxl)vab - align cols vertically to bottom on needed displays

Useful mods for col element:

  • (s|m|l|xl|xxl) - auto width on needed displays
  • (s|m|l|xl|xxl)w - width on needed displays, 0 hide col on this device
  • (s|m|l|xl|xxl)o - offset on needed displays

  • (s|m|l|xl|xxl)of - order first this col on needed displays

  • (s|m|l|xl|xxl)ol - order last this col on needed displays

Authors

Ideas

Please, talk about your ideas by GitHub issues.

MIT License