项目作者: syaifulsz

项目描述 :
A Bootstrap 3 responsive helper for adding width to inline block. The widths are calculated based on element parent container and are based on 12 grid columns.
高级语言: CSS
项目地址: git://github.com/syaifulsz/bootstrap-helper-blocks.git
创建时间: 2017-03-09T11:58:50Z
项目社区:https://github.com/syaifulsz/bootstrap-helper-blocks

开源协议:MIT License

下载


Bootstrap Helper: Blocks

This is a responsive helper for adding width to inline block. The widths are calculated based on element parent container and are based on 12 grid columns.

These helper supports Bootstrap 3 responsive utilities (xs, sm, md, lg). Additional media queries is configurable and can be extended depending on your project requirements.

Getting Started

Download latest version or install by bower:

  1. bower install bootstrap-helper-blocks

Include this stylesheet code into your site:

  1. <link rel="stylesheet" href="dist/bootstrap-helper-blocks.min.css" />

If you want to have a responsive margin-padding helper, include this stylesheet too:

  1. <link rel="stylesheet" href="dist/bootstrap-helper-blocks-responsive.min.css" />

Example usage:

  1. <div class="clearfix">
  2. <div class="pull-left block--1-2">
  3. <a href="#" class="btn btn-primary btn-block">Submit</a>
  4. </div>
  5. <div class="pull-left block--1-2">
  6. <a href="#" class="btn btn-danger btn-block">Cancel</a>
  7. </div>
  8. </div>

Example usage with responsive media query:

  1. <div class="clearfix text-center">
  2. <div class="pull-left block-md--1-2 block-sm--1-4 block-xs">
  3. Box 1
  4. </div>
  5. <div class="pull-left block-md--1-2 block-sm--1-4 block-xs">
  6. Box 2
  7. </div>
  8. <div class="pull-left block-md--1-2 block-sm--1-4 block-xs--1-2">
  9. Box 3
  10. </div>
  11. <div class="pull-left block-md--1-2 block-sm--1-4 block-xs--1-2">
  12. Box 4
  13. </div>
  14. </div>

Extends and compile with Bootstrap 3 SASS

You’re required to install these in order to extends this helper:

  • NodeJS
  • Grunt CLI
  • Ruby
  • SASS

Installation

Run:

  1. npm install

Compile

Run:

  1. grunt

Enable Bootstrap 3’s responsive utilities for this helper

Change these variables to true.

  1. $helper-block--xs: false
  2. $helper-block--sm: false
  3. $helper-block--md: false
  4. $helper-block--lg: false

Adjust grid columns

Adjust grid column here:

  1. $grid: 12