GithubHelp home page GithubHelp logo

arjan0307 / less-rails-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metaskills/less-rails-bootstrap

0.0 2.0 0.0 414 KB

CSS toolkit from Twitter For Rails 3.1 Asset Pipeline

Ruby 87.68% Shell 11.05% JavaScript 1.27%

less-rails-bootstrap's Introduction

Less Rails Bootstrap

Bootstrap is Twitter's toolkit for kickstarting your site or app's CSS. It includes base styles for typography, forms, buttons, tables, grid layout, navigation, alerts, and more. To get started -- check out the Bootstrap docs.

The less-rails-bootstrap project hooks into less-rails and less.rb, making Bootstrap's source LESS files, compiled CSS, and JavaScript files available in the Rails 3.1+ asset pipeline.

The benefits:

  • Assets are namespaced in twitter/bootstrap to avoid asset conflicts.
  • Top level requires to get all stylesheets or javascripts.
  • Ability to import or require individually namespaced stylesheets or javascripts.

Installation

LESS requires a JavaScript runtime to work. Which one you use depends on your Ruby implementation. Two are shown for Ruby (MRI) and JRuby. Add only the relevant one to your Gemfile. If you want to use Bootstrap's JavaScript plugins, also add the jquery-rails gem. Finally, add less-rails-bootstrap and run bundle install.

# Gemfile

gem 'therubyracer'  # If using Ruby
gem 'therubyrhino'  # If using JRuby
gem 'jquery-rails'  # If using Bootstrap's JS plugins.
gem 'less-rails-bootstrap'

Basic CSS Use

Get the full Bootstrap stylesheet with a single line in your application.css.

/*
  *= require twitter/bootstrap
*/

Please see the less-rails-bootstrap-test repo for examples that customize the CSS output by using LESS. The "CSS Tests Suites" section of the README and code is what you want to focus on. Also, check out the LESS syntax.

Basic JavaScript Use

In application.js, require jQuery first. Now you can add all the Bootstrap plugins with a single line.

//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap

Or include plugins individually.

//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap/modal
//= require twitter/bootstrap/alert

Versioning

This gem will directly track the semantic versioning of the Twitter Bootstrap project. Our major and minor versions will always match to theirs, though we may have tiny patch level releases specific to this gem.

Testing

Simple! Just clone the repo, then run bundle install and bundle exec rake. The tests will begin to run. We also use Travis CI to run our tests. The current build status is:

Build Status

We also have a test rails project setup using all the examples documented above. If you make a github issue and complain about something, I will likely forward you to this project.

https://github.com/metaskills/less-rails-bootstrap-test

Contributing

Here are the steps to update the version of twitter bootstrap used.

  • Clone this repository.
  • Clone the bootstrap repo in a twitter/bootstrap directory next to the clone of less-rails-bootstrap done above.
  • Change directories into the twitter/bootstrap clone and do a git checkout on the version you are targeting. For example git checkout v2.3.0. This will setup the proper version to copy over.
  • Back in the less-rails-bootstrap project. Run the ./scripts/update_bootstrap.sh script.
  • RUN THE TESTS!

License

Twitter Bootstrap Project: http://twitter.github.com/bootstrap

Copyright 2011 Twitter, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Less::Rails is Copyright (c) 2011 Ken Collins, [email protected] and is distributed under the MIT license.

less-rails-bootstrap's People

Contributors

metaskills avatar spider-network avatar vickash avatar lloeki avatar sabril avatar almancill avatar andersonfreitas avatar bbenezech avatar brianhartsock avatar cowboyd avatar darkside73 avatar thejonanshow avatar ricswirrl avatar mynameisrufus avatar barbergeek avatar trentclowater avatar desheikh avatar stratequip avatar

Watchers

James Cloos avatar  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.