Giter Site home page Giter Site logo

bootstrap3's Introduction

Bootstrap 3 for Meteor

Modular, configurable, customizable.

How to use

  1. In your Meteor project, create an empty file named bootstrap-settings.json and place it in any client folder.

  2. Install package

     meteor add huttonr:bootstrap3
    

The package will automatically populate the bootstrap-settings.json file if it is empty.

For those newer to Meteor

Client folder means any folder in your Meteor project that is loaded on the client only. Per the Meteor documentation on file structure that would be any folder named client. The usual place to put files relating to style (such as Bootstrap) is client/stylesheets. All you have to do is make an empty file named bootstrap-settings.json and place it in client/stylesheets or some similar folder (you might have to make the folders).

Then go to your console and type meteor run and the huttonr:bootstrap3 package will automatically fill your bootstrap-settings.json file with all of the default settings. At this point you will be able to use bootstrap classes in your html files such as <div class="container jumbotron">Hello World</div> or <span class="glyphicon glyphicon-heart"></span>.

Custom settings

The settings json file is automatically populated with the default settings, however each of these can be changed and individual modules can be turned on and off. The default bootstrap-settings.json file has the following structure:

{
  "less": {
    "customVariables": false,

    "exposeMixins": false,

    "compile": true,

    "modules": {
       "alerts": true,
       "badges": true,
       "breadcrumbs": true,
       "button-groups": true,
       "buttons": true,
       "carousel": true,
       "close": true,
       "code": true,
       "component-animations": true,
       "dropdowns": true,
       "forms": true,
       "glyphicons": true,
       "grid": true,
       "input-groups": true,
       "jumbotron": true,
       "labels": true,
       "list-group": true,
       "media": true,
       "modals": true,
       "navbar": true,
       "navs": true,
       "normalize": true,
       "pager": true,
       "pagination": true,
       "panels": true,
       "popovers": true,
       "print": true,
       "progress-bars": true,
       "responsive-embed": true,
       "responsive-utilities": true,
       "scaffolding": true,
       "tables": true,
       "thumbnails": true,
       "tooltip": true,
       "type": true,
       "utilities": true,
       "wells": true
    }
  },

  "javascript": {
    "expose": false,

    "modules": {
      "affix": true,
      "alert": true,
      "button": true,
      "carousel": true,
      "collapse": true,
      "dropdown": true,
      "modal": true,
      "popover": true,
      "scrollspy": true,
      "tab": true,
      "tooltip": true,
      "transition": true
    }
  }
}

These settings perform the following duties:

less

customVariables Boolean (default: false) Enable this to expose a custom bootstrap variables file you can edit.
exposeMixins Boolean (default: false) Enable this to expose an importable less file with the bootstrap mixins for your use.
compile Boolean (default: true) Disable this to expose the raw bootstrap less and leave it to the less package to compile.
modules Object Enable or disable specific bootstrap less modules. (The listed order of these is unimportant.)

javascript

expose Boolean (default: false) Enable to expose the raw bootstrap javascript.
modules Object Enable or disable specific bootstrap js modules. (The listed order of these is unimportant.)

Using custom variables or mixins

Custom variables are made easy with this package. First change customVariables in the settings file to true which will expose the variables file for you to edit. You will need to run your meteor project (if it's not already running) and you will see a file named bootstrap-variables.less. You can change anything in this file. You can also delete any portion of it that you do not wish to change from the default value. These variables simply override the default settings so it's safe to delete anything you aren't using.

You can also use this custom variables less file in your own less code if you would like by importing it:

// my-custom.less
@import "bootstrap-variables.less";

/* Custom less using Bootstrap variables here */

The exact same goes for mixins. Mixins are currently not editable. They are exposed solely for your use in construction:

// my-custom.less
@import "bootstrap-variables.less";
@import "bootstrap-mixins.less";

/* Custom less using Bootstrap mixins and variables here */

bootstrap3's People

Contributors

huttonr avatar jonatanblue avatar

Watchers

James Cloos avatar

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.