4.0.0-beta.1 • Published 7 years ago

bem-bootstrap v4.0.0-beta.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

BEM with Bootstrap

Usage

npm i -D bem-bootstrap

Add .bem/enb-make.js:

const nodeConfigSetup = require('bem-bootstrap');
const isProd = process.env.YENV === 'production';
const levels = [
    { path: 'node_modules/bem-bootstrap/components', check: false }
];

module.exports = function (config) {

    config.nodes('bundles/*', function (nodeConfig) {
        nodeConfig.addTechs(nodeConfigSetup(levels, isProd));

        nodeConfig.addTargets([
            '?.html',
            '?.min.js',
            '?.min.css'
        ]);
    });
};

Add bundles/index/index.bemjson.js:

module.exports = {
    block: 'page',
    title: 'Title of the page',
    favicon: '/favicon.ico',
    head: [
        { elem: 'meta', attrs: { name: 'description', content: '' } },
        { elem: 'meta', attrs: { name: 'viewport', content: 'width=device-width, initial-scale=1' } },
        { elem: 'css', url: 'index.min.css' }
    ],
    scripts: [{ elem: 'js', url: 'index.min.js' }],
    content: [
        {
            block: 'container',
            mods: {
                fluid: true
            },
            content: [
                {
                    block: 'alert',
                    mods: {
                        success: true,
                        dismissible: true
                    },
                    content: '<strong>Holy guacamole!</strong> You should check in on some of those fields below.'
                }
            ]
        }
    ]
};
npm start

Docs

Videos