Code Monkey home page Code Monkey logo

bootstrap-sass-namespace's Introduction

Namespaced Bootstrap

This project is designed to bring Bootstrap which doesn't conflict with existing CSS and JS of a website.

You should consider using this project if you need to apply Bootstrap partially. ie to particular div of a page.

Contribute

Even though the project is in alpha stage, it serves it's initial purpose pretty accurately. If you find any problem, you're more than welcomed to create an issue or pull request.

How to use

  1. Install
npm install --save bootstrap-sass-namespace
  1. Define class prefix in SASS.
$class-prefix: 'my-namespace';
@import "node_modules/bootstrap-sass-namespace/assets/stylesheets/_bootstrap.scss";
  1. Define class prefix in JS before including JS assets.
<script>
    BOOTSTRAP_NAMESPACE = 'my-namespace';
</script>
<script src="assets/javascripts/bootstrap.min.js"></script>
  1. Use special class notation *prefix*-html-*tag* on every tag. Below you can find an example of drop down menu.
<div class="my-namespace-html-div my-namespace-dropdown">
  <button class="my-namespace-html-button my-namespace-btn my-namespace-btn-default my-namespace-dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
    Dropdown
    <span class="my-namespace-html-span my-namespace-caret"></span>
  </button>
  <ul class="my-namespace-html-ul my-namespace-dropdown-menu" aria-labelledby="dropdownMenu1">
    <li class="my-namespace-html-li"><a class="my-namespace-html-a" href="#">Action</a></li>
    <li class="my-namespace-html-li"><a class="my-namespace-html-a" href="#">Another action</a></li>
    <li class="my-namespace-html-li"><a class="my-namespace-html-a" href="#">Something else here</a></li>
    <li class="my-namespace-html-li my-namespace-divider" role="separator"></li>
    <li class="my-namespace-html-li"><a class="my-namespace-html-a" href="#">Separated link</a></li>
  </ul>
</div>

License

(MIT License)

Copyright (c) 2016 Dima Snisarenko [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bootstrap-sass-namespace's People

Contributors

aeyoll avatar bbenezech avatar blackhawkso avatar corny avatar cvrebert avatar danielbayerlein avatar dinuz avatar glebm avatar grosser avatar jkelleyj avatar mahnunchik avatar marshallku avatar maxguzenski avatar mhlavac avatar mjonuschat avatar nerian avatar nickurban avatar niklas avatar noahd1 avatar nschonni avatar rafaelfranca avatar sbandyopadhyay avatar sneas avatar sporkd avatar thetamind avatar thomas-mcdonald avatar trisweb avatar umairsiddique avatar walgitrus avatar wndxlori avatar

Watchers

 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.