Giter Club home page Giter Club logo

compass-twitter-bootstrap's Introduction

HEADS UP:

This gem is no longer being actively maintained.

If you need Bootstrap 3 on Sass you should use this: https://github.com/twbs/bootstrap-sass

Twitter Bootstrap - For Compass

Compass Twitter Bootstrap is Twitter's toolkit converted for Compass.

Demo App at https://github.com/vwall/Compass-Twitter-Bootstrap-Demo-App

Usage

Install the gem

gem install compass_twitter_bootstrap

Add it to your Gemfile

gem 'compass_twitter_bootstrap'

Bundle install

bundle install

Add it to your Compass config.rb

require 'compass_twitter_bootstrap'

Import it into your SCSS file

@import "compass_twitter_bootstrap";

Usage with asset pipeline(Rails 3.2)

Add these gems to your Gemfile. To learn about the new compass-rails gem, see https://github.com/Compass/compass-rails for more info.

gem 'compass_twitter_bootstrap'
gem 'compass-rails'

Bundle install

bundle install

Add it to your Application.rb

# Enable the asset pipeline
config.assets.enabled = true

Import it into your SCSS file

@import "compass_twitter_bootstrap"

Import twitter bootstrap responsive if you're looking for that

@import "compass_twitter_bootstrap_responsive"

Usage with Rails 3.1 (via plugin)

Install plugin

rails plugin install git://github.com/vwall/compass-twitter-bootstrap.git

Add it to your config/initializers/sass.rb

Rails.configuration.sass.tap do |config| ...

# twitter bootstrap
config.load_paths << Compass::Frameworks['twitter_bootstrap'].stylesheets_directory

...
end

Import it into your SCSS file

@import "compass_twitter_bootstrap"

To use the font awesome font and icons simply change the standard import to:

@import "compass_twitter_bootstrap_awesome"

Using Javascripts with Rails Asset Pipeline

Javascript Libraries are located in vendor/assets/javascripts

Include them individually or

//=require bootstrap-all

to include all files

SCSS to SASS Conversion tip

To easily convert .scss files to .sass files you can use this little bash script:

$ for f in *.scss; do sass-convert -F scss -T sass $f ${f%%.*}.sass; done

To convert all twitter bootstrap .scss files to .sass (with overwrite):

$ for f in stylesheets/compass_twitter_bootstrap/*.scss; do sass-convert -F scss -T sass $f stylesheets_sass/compass_twitter_bootstrap/${f%%.*}.sass; done

$ for f in stylesheets/*.scss; do sass-convert -F scss -T sass $f stylesheets_sass/${f%%.*}.sass; done

Nice and easy :)

Upgrading

If you want to contribute and help out keeping this gem in sync with the latest release of Twitter Bootstrap, you should keep in mind that all mixins are prefixed with ctb-. With this prefixed we can't run into problems where the converted less-mixins conflict with native Compass names, parameters, ...

There is a Rake-task that will help you to fetch all recent changes from the Twitter Bootstrap master:

rake convert

When that is done

@remark: if some Ruby-genius wants to automate this feel free

TWITTER BOOTSTRAP

Bootstrap is Twitter's toolkit for kickstarting CSS for websites, apps, and more. It includes base CSS styles for typography, forms, buttons, tables, grids, navigation, alerts, and more.

To get started -- checkout http://getbootstrap.com!

AUTHORS

Mark Otto

Jacob Thornton

##Copyright and License

Copyright 2012 Twitter, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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.

compass-twitter-bootstrap's People

Contributors

alsquire avatar ascrazy avatar astew8 avatar bopm avatar danielres avatar defv avatar dnedbaylo avatar eugene-p avatar friesencr avatar ibrahimkarahan avatar joliss avatar jpfuentes2 avatar kristianmandrup avatar lerouquin avatar matenia avatar nishp1 avatar paramburu avatar ravidsrk avatar skyeagle avatar stefl avatar stephenway avatar tagcincy avatar thetizzo avatar tijsverkoyen avatar tjgfernandes avatar tmaier avatar toao avatar trabus avatar vwall avatar wyuenho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compass-twitter-bootstrap's Issues

Update to Bootstrap 2.2

I think many of us using Yeoman are excited about the recent Bootstrap v2.2.0 update!

Though it would be good to wait until the Carousel bug is fixed here, as that's kinda big if you're using that component: twbs/bootstrap#5688

Asset precompile seems significantly slower

I have not been able to ascertain what the exact cause is but including both compass_bootstrap_twitter and compass_bootstrap_twitter_responsive seems to have an extraordinarily long compile time. Much longer than pre-2.0. I'm going to run some tests to see if it is just the responsive part or the core part.

Missing labels partial?

I am getting a build error for current 2.0.3 build. It fails to build because it can not find labels partial.

Installation Issues: ERROR: While executing gem ... (RuntimeError)

$ gem 'compass_twitter_bootstrap'
ERROR: While executing gem ... (RuntimeError)
Unknown command compass_twitter_bootstrap

This is on an Ubuntu 10.04 server. Any help or alternative
installation ideas appreciated.

$ gem --version
1.8.10

$ gem list

*** LOCAL GEMS ***

chunky_png (1.2.0)
compass (0.11.5)
compass-susy-plugin (0.9)
compass_twitter_bootstrap (0.1.7)
css_parser (1.1.9)
ffi (1.0.9)
fssm (0.2.7)
rake (0.9.2.2)
rb-inotify (0.8.8)
rubygems-update (1.8.10)
sass (3.1.5)

Less variable overrides are ignored

Here is my application.css.scss

@import "compass_twitter_bootstrap";
@import "compass_twitter_bootstrap_responsive";

@import "partials/base";

and in partials/_base.scss I have the line:

$baseFontSize:          16px;

As far as I understand it this should override the ridiculously small base font size bootstrap comes with by default, but it doesn't seem to have any effect. Any idea what I'm doing wrong?

Please prefix all mixins to avoid conflicts

Currently this project defines/redefines a lot of SCSS mixins that have the same name as Compass' with slightly different behavior. Please refactor all the mixin uses in this project to use prefixed mixins local to this plugin to avoid namespace conflicts.

Form layouts broken

In some instances, form layouts are not working correctly.

For example - form-inline layouts where an input has an append AND prepend do not work.

Another example - form-inline layouts with a appended button do not work correctly.

Example code follows;

        <form class="form-horizontal">
            <fieldset>
                <legend>Form control states</legend>

                <div class="control-group">
                    <label class="control-label" for="appendedPrependedInput">Append with button</label>
                    <div class="controls">
                        <div class="input-append">
                            <input class="span2" id="appendedPrependedInput" size="16" type="text"><button class="btn" type="button">Go!</button>
                        </div>
                    </div>
                </div>
            </fieldset>
        </form>

Let's agree to a prefix and always prefix mixins when converting

As reported on issue #52, bootstrap mixins have names, parameters and behaviors that conflict with Compass'. However, since that ticket was closed and pull requests merged, maybe because I'm the only person unlucky enough to be affected by this issue, or that looking at the giant diff takes too much effort, I keep seeing newer pull requests coming in without the prefix or use a different one.

In my pull request #53, I opted to use "bootstrap-" as the prefix, but maybe that's not a good one. Can we agree on a prefixed please?

@vwall @tijsverkoyen @kristianmandrup?

Can't load javascripts...

I'm trying to load a Twitter Bootstrap .js file, with something like this in my application.js file: //= require bootstrap-alerts and it's blowing up. Is that how you do it?

I did notice that in my compass_twitter_bootstrap-0.1.7 gem directory, the vendor/assets directory is missing.

Less escape e() causes problems

Using version: 2.0.1.2

I'm getting an error:

Sass::SyntaxError: wrong number of arguments (1 for 0) for `e' (in app/assets/stylesheets/base.css.sass)

/Volumes/Clank/Users/Mike/.rvm/gems/ruby-1.9.2-p290@socialply/gems/compass_twitter_bootstrap-2.0.1.2/stylesheets/compass_twitter_bootstrap/_mixins.scss:540:in `buttonBackground'

Browsing the file, I see 3 or so instances of a mixin: e(). Doing a search reveals that this is a less function for escaping the content. I'm not sure what the correct course of action is, but I commented out each use of e() to get working.

local path problem

hi everybody,
i'm working on an app based on rails 3.2.6.
for a particular reason i have to install all the gems in a local folder inside the app (vendor/gems/)
i've install compass_twitter_bootstrap successfully but when i try to import the stylesheet (@import 'compass_twitter_bootstrap') i receive this error:

File to import not found or unreadable: compass_twitter_bootstrap.

it seems a path issue. i've tried to add the folder into the config.assets.paths but nothing seems to work.
any tips?

Can't import compass_twitter_bootstrap_responsive

Get an error with the imports:

File to import not found or unreadable: variables.
Load paths:
  Sass::Rails::Importer(/Users/chrisn/dev/pixelpublish/app/assets/stylesheets/application.css.scss)
  /Users/chrisn/.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.7/frameworks/compass/stylesheets
  /Users/chrisn/.rvm/gems/ruby-1.9.2-p290/bundler/gems/compass-twitter-bootstrap-d6c049504fcb/stylesheets
  (in /Users/chrisn/dev/pixelpublish/app/assets/stylesheets/application.css.scss)

Customize Grid

Hi

Is there any way to customize the grid properties without having to replicate the entire package (with edited grid attributes in _variables.scss) and compile a customized gem?

Some of the values can be overriden even after an import of the package (e.g. color variables) by defining them, however, for example the number of columns in the grid has no effect when setting the $gridColumns variable after or before the @import "compass_twitter_bootstrap"; import

.close opacity has wrong value after 2.1 update

The opacity values of 20 and 40 in the .close class of _close.scss has been changed to 0.2 and 0.4. The mixin divides this value by 100, which renders opacity: 0.002 and 0.004 respectively. As a result the X to close a modal is not visible.

Can't install with "compass install"

I don't have a rails project, thus don't have bundler or a Gemfile. But I do use compass, and would like to try the Twitter Bootstrap integration with Compass without having to use bundler. So far, I've successfully installed the gem:

gem install compass_twitter_bootstrap

But I can't seem to install the compass module with this:

webkell@ubuntu:~/Projects/bkell/public$ compass install compass_twitter_bootstrap
No such framework: "compass_twitter_bootstrap"

... or this:

webkell@ubuntu:~/Projects/bkell/public$ compass install compass-twitter-bootstrap
No such framework: "compass-twitter-bootstrap"

FontAwesome icons not appearing

Hi guys,

I'm having trouble with FontAwesome icons using
@import "compass_twitter_bootstrap_awesome";

The icons don't appear. (just a square placeholder instead of the icons)

Do I need to change anything else? Or there is some issue with it?

Thanks.

Semantic tutorial

Hi!
I recently found compass and sass because I don't use rails on my workflow but I'm pretty interested in using TB in a semantic way

So, now I have installed compass-twitter-bootstrap and I can use it in my projects (I've try semantic layout more or less and buttons)

My next step is use it with tabs but I can't understand the way to do that

I've tried something like this:

HTML

<nav>
    <ul>
        <li><a href="#">Menu Option 1</a></li>
        <li><a href="#">Menu Option 2</a></li>
        <li><a href="#">Menu Option 3</a></li>
    </ul>
</nav>

SCSS

nav {
    @extend .nav;
    @extend .nav-tabs;
}

but I don't have any tab (I only see the bottom line used in the TB tabs)

What am I missing?

Is this library what I want? (I mean if I could achieve my semantic needs with it or I need to search for a better solution)

Thanks a lot!!
Sorry for the advanced guys in the list pissed of with newbies questions

Modular suggestion

Just a suggestion, shouldn't it be better if there's also an option to just include a module of the twitter bootstrap instead of the whole thing?

Like if I wanted to just include the fonts and forms, i can just do:

@import "compass_twitter_bootstrap/fonts"
@import "compass_twitter_bootstrap/forms"

wrong number of arguments (1 for 0) for `e'

i'm using this gem for the first time and i have this error.

wrong number of arguments (1 for 0) for `e'
(in /Users/yestoall/Sites/kosas/app/assets/stylesheets/application.css.scss)

Push a new version of the gem

The version in github has the Font Awesome 2.0 fonts. The latest version of the gem, 2.0.3, seems to lack these changes. Please publish a new version of the gem.

Thanks!

:compressed colors break navbar

When SASS style is set to :compressed, according to the docs, it may make subtitutions in colors, ie, #333333 becomes #333. This break the IE gradient mixin as described in http://stackoverflow.com/questions/9780464/twitter-bootstrap-nav-bar-issues-in-internet-explorer

When only 3 hex digits are specified, such as

filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333',endColorstr='#222', GradientType=0)

Is results in a blue gradient, no matter what.

So a solution would be to change the compression to :compact - but I cannot for the life of me get any config settings to be noticed to achieve this. I've tried config.sass.style in the environent files(no change), Sass::Plugin[:style](bombs with and undefined constant), compass.rb config file as found in the demo app.... nothing ever changes the compression format.

So first of all, how can one change the compression format, and does anyone have an idea how to prevent color compression in IE filter rules?

Can't install compass-twitter-bootstrap

Hello, I'm just really frustrated about that, I'm newbie on ruby/rails and I can't understand how to proceed to install it.

First of all, I'm on a Mac running LION, my 'Ruby 1.8.7' and 'Rails 3.2.9' and I had Xcode 4.5.2 already installed with the 'Command Line Tools'. So I've opened the TERMINAL and I followed this steps:

1- gem install compass_twitter_bootstrap; OK
2- gem 'compass_twitter_bootstrap',
It returns: ERROR: While executing gem ... (RuntimeError)
Unknown command compass_twitter_bootstrap

How I proceed to solve that problem?

I'm also using codekit.

Compass grid mixins in 2.0?

I'm coming from a blueprint background, so maybe my impression of what a compass plugin should be is skewed, but I always thought the point of compass + grid was to do things like this (using bootstrap terminology):

#sidebar
  +span(4)
#content
  +offset(4)
  +span(8)

as opposed to hard-coding it in the HTML like this:

<div id="sidebar" class="span4"></div>
<div id="content" class="offset4 span8"></div>

If I wanted the latter, what advantage does compass provide over a plain scss/sass-based approach?

The previous version of this project had a +columns mixin I was using which I will probably just redefine, but am I crazy? Has the use case for compass changed, or is this an oversight?

btn:hover effect doesn't work in IE

Hi, I noticed that there is no mouse-over effect on btn-primary in IE8, but this works if I use the precompiled bootstrap.css. So I started digging...

I compared the css and found that the button's background colour is different in the compass generated css. This is happening because of a small difference between mixins.less and mixins.scss. The less version uses the sass mix() function for gradient-vertical and gradient-vertical-three-colors, while the scss version doesn't.

If I've understood the build process correctly, mixins is the only file that doesn't get auto-magically ported..? So, I've forked and corrected it and will make a pull request shortly...

Cheers.

P.S. thanks for making this gem - it's awesome

I must be missing something with regards to variables

Hi,

I think I'm misssing something obvious here. Let's say I add the following two lines to my scss file so I can change a couple bootstrap default variables:

$navbarHeight: 100px;
$navbarBackground: red;

When compass compiles the new .css file, the values I put in are being ignored and the default bootstrap values are being used.

What am I doing wrong?

Thanks,

Scot

Font Awesome for responsive layout

How can I import the font awesome with the responsive layout without screwing around in the gem?

@import "compass_twitter_bootstrap_responsive"
@import "compass_twitter_bootstrap/font-awesome"

throws
Invalid CSS after "...rap_responsive"": expected selector or at-rule, was "@import "compas..."

Or: can we get a compass_twitter_bootstrap_responsive_awesome?

Btw: why is the _awesome so long? can't you just do import the normal one and then do an @import font-awesome? (just asking, still new to SASS)

Issues with Compass 0.12.1

Please push a gem to RubyGems.org. Current gem does not include needed fixes to cooperate with Compass 0.12.1.

Modal window not animating

Hi, first of all great extension I've been playing around with it for a couple hours and noticed the modal window wasn't animating right, I looked at the code and noticed an e() mixing in the .fade class here:

https://github.com/vwall/compass-twitter-bootstrap/blob/master/stylesheets/compass_twitter_bootstrap/_patterns.scss#L803

I was wondering what it does since it's not getting compiled right and the css ends up like:

.modal.fade {
  -webkit-transition: e("opacity .3s linear, top .3s ease-out");
  -moz-transition: e("opacity .3s linear, top .3s ease-out");
  -ms-transition: e("opacity .3s linear, top .3s ease-out");
  -o-transition: e("opacity .3s linear, top .3s ease-out");
  transition: e("opacity .3s linear, top .3s ease-out");
  top: -25%;
}

Sprites images not accessible

_sprites.scss links to background image like this:
background-image: url(../img/glyphicons-halflings.png);

And image is not accessible from compiled application.css

dropdown-menu

it seems twitter bootstrap has the class="dropdown-menu"option.

But always when I add this class to an ul Element the whole content get's lost.
The dropdown.js is loaded correctly.

http://rc.getbootstrap.com/javascript.html#dropdowns

Twitter nested dropdown function:

http://rc.getbootstrap.com/components.html#dropdowns

My Demo Code looks like this:

<div class="dropdown">
    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
        <li>test</li>
        <li>test</li>
        <li>test</li>
    </ul>
</div>

Jqeury method 'on' not found when loading bootstrap-alerts.js

This may just be some issue with bootstrap, but I have this in my application.js:

//= require jquery_ujs
//= require_tree .
//= require bootstrap-alert
//= require bootstrap-button
//= require bootstrap-tab
//= require bootstrap-tooltip
//= require bootstrap-transition
//= require bootstrap-dropdown
//= require bootstrap-modal
//= require bootstrap-popover

However on page load I get a method messing error from bootstrap-alert

TypeError: Object [object Object] has no method 'on'

which occurs at this line in bootstrap-alert.js

  $(function () {
    $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
  })

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.