GithubHelp home page GithubHelp logo

metaskills / less-rails-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
561.0 13.0 131.0 1.91 MB

The most popular front-end framework for developing responsive, mobile first projects on the web for Rails asset pipeline.

Ruby 79.76% Shell 16.03% JavaScript 0.69% CSS 3.52%

less-rails-bootstrap's People

Contributors

almancill avatar andersonfreitas avatar arjan0307 avatar barbergeek avatar bbenezech avatar brianhartsock avatar cowboyd avatar darkside73 avatar desheikh avatar lloeki avatar maxd avatar metaskills avatar mynameisrufus avatar pemulis avatar ricswirrl avatar sabril avatar simi avatar spider-network avatar stratequip avatar thejonanshow avatar trentclowater avatar vickash 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

less-rails-bootstrap's Issues

What if include some help to make bootstrap more compatible with rails

Hey,

What do you think is it OK to include helpers into the gem for rendering correct flash messages

module ApplicationHelper
  def twitterized_type(type)
    return "error" if type == :alert
    return "info" if type == :notice

    type.to_s
  end
end
- flash.each do |type, content|
  div class="alert fade in alert-#{twitterized_type(type)}"
    = content
    a.close data-dismiss="alert" ร—

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Production/Development Javascript Problems

When pushing to production, the javascript is not working. It works fine locally, but not in production.

If I change config.assets.debug to false in config/environments/development.rb it mimics the same non working js. Any help with this one?

I am specifically using the dropdown functionality in twitter bootstrap.

Header Value Not Changing

Sorry if this is the wrong place to post but not sure where to post questions if anyone knows I will post there.
I have installed the less-rails-bootstrap gem and have a global.css.less file

inside I have this
@import "twitter/bootstrap";
@color: #4D926F;

header {

color: @color;
}
h2 {
color: @color;
}

now in my view I have

This is the header

It is currently not changing the setting. Is there a compile I have to do? is this in the correct place? do I need to
do anything in applicaiton.rb

Thanks
Dave

Bootstrap 3 RC1

Hello,

Could you please update 3.0.0-wip branch to Bootstrap 3 RC1?

Thanks

Cannot precompile assets, only works in development environment

Hi,

Can you precompile the assets? In a vanilla app with empty stylesheets (just less-rails-bootstrap in my Gemfile) I get...

bundle exec rake assets:precompile
rake aborted!
file 'reset.less' wasn't found.

(in /Users/erdah/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1/gems/less-rails-bootstrap-1.3.2/vendor/assets/stylesheets/twitter/bootstrap/bootstrap.less)

IE9 hack in forms.less fails asset precompilation

The asset precompiler fails with an Invalid CSS error on the IE9 hack on line 89 of forms.less.

In input[type=radio]
border-radius: 0 e("\0/"); // Nuke border-radius for IE9 only

Invalid CSS after "...er-radius:0 \0/": expected expression (e.g. 1px, bold), was ";}"

Problem precompiling with rails 3.2.2

When I run bundle exec rake assets:precompile I get the following:

/Users/brice/.rbenv/versions/1.9.3-p125/bin/ruby /Users/brice/.rbenv/versions/1.9.3-p125/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
couldn't find file 'twitter/bootstrap'
  (in /Users/brice/code/splash/app/assets/javascripts/application.js:16)

Otherwise, the gem loads fine in development environment.

full control and assets:precompile

I am using a bootswatch theme that provides custom variables.less (https://gist.github.com/2024459) and bootswatch.less (https://gist.github.com/2024455).

assets/bootswatch/index.css.less looks like https://gist.github.com/2024437

bootswatch.css:
/*
*= require bootswatch/index
*/

demo.rb:
config.assets.precompile += %w( bootswatch.css )

In development environment everything compiles fine.

When running bundle exec rake RAILS_ENV=demo RAILS_GROUPS=assets assets:precompile I get:
variable @textcolor is undefined
(in /app/assets/stylesheets/bootswatch/bootswatch.less)

Variables names @gridGutterWidth and @grid-gutter-width. Name conflict

Using less-rails-bootstrap (3.0.0.1)

The Varibles.less file in app/frameworks/twitter/bootstrap contains
the following vars for Grid Definition:
// Number of columns in the grid system
@grid-columns: 12;
// Padding, to be divided by two and applied to the left and right of all columns
@grid-gutter-width: 30px;
// Point at which the navbar stops collapsing
@grid-float-breakpoint: @screen-tablet;

But the layouts.less file looks for @gridGutterWidth

There are several other examples of missing variable names, and they seem to be related to a mixup of versions of variables.less. When and why did the var names change?

Error in alert.js:89 "TypeError: 'undefined' is not a function"

Hi,

I'm having the following Javascript error:
TypeError: 'undefined' is not a function (evaluating '$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)')
in alert.js:89

My application.js looks like this:

//= require jquery
//= require jquery_ujs
//= require jwysiwyg/jquery.wysiwyg.js
//= require_tree .
//= require twitter/bootstrap

I've tried removing require_tree or removing jwysiwyg and still the same error.

If I remove alert.js, then I receive another similar error with the next button.js:96

TypeError: 'undefined' is not a function (evaluating '$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
$(e.target).button('toggle')
})')

I'm not so experimented with Rails 3.1.0 or Twitter Bootstrap but the project I'm working on is standard rails 3.1.0 project.

Gems list:
less (2.0.9)
less-rails (2.1.5)
less-rails-bootstrap (2.0.3)
rails (3.1.0)

couldn't find file 'twitter/bootstrap'

My app can't seem to find the "twitter/bootstrap" file that this gem should be loading up. It's surprising because I recall a previous version working just great (though I am now using rails 4). I get the same issue when I run rake assets:precompile.

I tried reinstalling this gem, as well as reinstalling less and less-rails. Still no luck. Any ideas about what I might be missing?

Bootstrap 2.0 not working

From what I've read, it looks like this gem is updated for the 2.0 release of Twitter Bootstrap. I followed ReadMe instructions and have included the gem but when I reference 2.0 class names instead of the ones I am currently using from 1.4 (navbar instead of topbar for example) the css styling breaks. I'm new to Rails and programming, but wanted to confirm it was updated and see if you had any clue what I'm doing wrong?

I apologize if this isn't the proper place to ask, I've also posted more info on stackoverflow. (http://stackoverflow.com/questions/9197600/rails-3-1-app-stuck-in-v1-4-of-twitter-bootstrap)

Feature Request: ensuring clean mixins.less

Hi @metaskills,

See twbs/bootstrap#3608 for context.

I'm very intent on being able to import files from bootstrap that only contain parametric mixins (whether that is from mixins.less, or otherwise), but it appears the the bootstrap team are not going to consider my patch which shows how this could be done.

I know this is a stretch, but I wonder if you would consider that as part of less-rails-bootstrap. It would mean additional effort in when revving bootstrap version... I'd be happy to help with that.

Thanks!

data-method="delete" doesn't work in dropdown menus

Title says it all. If there's a link in a dropdown menu that has :method => :delete, it will just make a GET request. I believe this has to do with the most recent changes to the dropdown code in Bootstrap 2.1.0

Jammit

Is there a way to use Jammit or any other compressor with less-rails-bootstrap?

undefined method `NewInstance' for #<V8::C::Value:0x000001014fe8c0>

Hey I am playing with the gem on a basic app with ruby 1.9.2 and rails 3.1.1.

I added the gem to my gemfile as:

gem 'less-rails-bootstrap'

Thiss is my application.css file:

/*
 * This is a manifest file that'll automatically include all the stylesheets available in this directory
 * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
 * the top of the compiled file, but it's generally better to create a new file per style scope.
 *= require twitter/bootstrap
 *= require_self
 *= require_tree . 
*/

Restarted My server and tried accessing my application and got this error:

Completed 500 Internal Server Error in 249ms

ActionView::Template::Error (undefined method `NewInstance' for #<V8::C::Value:0x000001014fe8c0>
  (in /Users/chopi/.rvm/gems/ruby-1.9.2-p136@testing/gems/less-rails-bootstrap-2.0.3/vendor/assets/stylesheets/twitter/bootstrap.css.less)):
    2: <html>
    3: <head>
    4:   <title>Testing</title>
    5:   <%= stylesheet_link_tag    "application" %>
    6:   <%= javascript_include_tag "application" %>
    7:   <%= csrf_meta_tags %>
    8: </head>
  app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___2037363003152249557_2477053420'

Any clues about this?

Please can this use less-rails 2.1.0?

Please can you update this gem to use less-rails 2.1.0. I've hacked my local version of less-rails-bootstrap, to do just that, and it fixes a bunch of asset compression issues. Thanks!

Document process for updating Bootstrap

What's the process for updating Bootstrap within this gem? For example, Bootstrap 2.3 was released recently, and I want to use that via this gem. How do I get it in there so I can submit a pull request without causing you much grief?

If you give me the gist of the process, I can document it somewhere too (wiki or wherever you think would be appropriate).

'less-rails' required in Gemfile

less-rails is not pulled in automatically... I get:

.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc1/lib/rails/railtie/configuration.rb:78:in `method_missing': undefined method `less' for #<Rails::Application::Configuration:0x007f83d253f388> (NoMethodError)

If I add "gem 'less-rails'" before "gem 'less-rails-bootstrap'" it works.

Asset Pipeline was broken in 3.0.0.1

Hello,

Compilation of LESS files from less-rails-bootstrap 3.0.0.1 through Asset Pipeline cause many compilation errors:

  1. variable @gridGutterWidth is undefined
    I define this variable.
  2. .ie7-restore-right-whitespace is undefined
    I removed this from sprites.less
  3. variable @iconSpritePath is undefined
    etc....

Looks like compilation of less files through Asset Pipeline was broken. Many files required for compilation was missed.

Thanks

Thanks

Can't @import individual modules...

From the README, it says you can import individual modules, like: @import "twitter/bootstrap/variables";

But this isn't working for me.

Does it have something to do with the fact that the individual modules are now under vendor/frameworks/ instead of vendor/assets/ ?

Override variables.less

Hi,
I'm guessing how to override the standard variables.less with a custum variables.less. The one in the gem package couldn't be wrote.

In my /app/assets/stylesheets/application.css.less I've tried to override in this way:

// Components: common
@import "twitter/bootstrap.less";
@import "myown_variables.less";

...but nothing happens...
Anyone could help me, pls?

twitter/bootstrap.js includes assets in the wrong order

In particular, there's a dependency from popover requiring tooltip loaded first, but
app/assets/javascripts/twitter/bootstrap.js just includes the individual assets in alphabetical order. Causes errors like this raised in popover:
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')

Seems this error appeared in 526356b and is because of the way that update_bootstrap.sh generates bootstrap.js(?)

For now I can workaround by including the assets individually, like this (the order as specified in https://github.com/twbs/bootstrap/blob/master/Gruntfile.js):
//= require twitter/bootstrap/transition.js
//= require twitter/bootstrap/alert.js
//= require twitter/bootstrap/button.js
//= require twitter/bootstrap/carousel.js
//= require twitter/bootstrap/collapse.js
//= require twitter/bootstrap/dropdown.js
//= require twitter/bootstrap/modal.js
//= require twitter/bootstrap/tooltip.js
//= require twitter/bootstrap/popover.js
//= require twitter/bootstrap/scrollspy.js
//= require twitter/bootstrap/tab.js
//= require twitter/bootstrap/affix.js

Not loading all CSS files

Since I adopted this gem the development has been a nightmare. I no mean any offence but my app does not behave like any Rails app. In development all styles are loaded, in staging not, some are missing. In staging only used to work with config.assets.compile = true and a file loader which imports the stylesheets:

@import 'twitter/bootstrap';
@import 'colours.css.less';
@import 'deal_timer.css.less';
@import 'divs.css.less';
@import 'drop_down.css.less';
@import 'forms.css.less';
@import 'images.css.less';
more imports ...

My application.css

*= require_self
*= require loader
*= require_tree .

Part of my Gemfile:

gem 'less-rails-bootstrap', :git => 'git://github.com/andersonfreitas/less-rails-bootstrap.git'
gem 'twitter_bootstrap_form_for', :git => 'git://github.com/stouset/twitter_bootstrap_form_for.git'

Gems used only for assets and not required

in production environments by default.

group :assets do
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
gem 'less-rails'
end

Why less-rails-bootstrap does not compile as CSS under assets/stylesheets? It is not normal in a standard app with 'sass-rails'

2.0-wip

Hi Ken

I did a 2.0-wip branch that uses 2.0-wip bootstrap CSS branch.

https://github.com/sgruhier/less-rails-bootstrap

If you are interested to have it in your official repository, I can make a pull request and I'll be happy to maintain it.
if not no big deal, I'll use my fork.

Thanks for this great gem

Seb

Icons doesn't display

Hi,
I'm having some problems with icon- class. The icons does not display.

In the code, I've found this problem:

[class^="icon-"],
[class*=" icon-"] {
...
  background-image: url(/assets/"/assets/twitter/bootstrap/glyphicons-halflings.png");
...

corresponding to these less lines in the vendor framework folder:

background-image: asset-url("@{iconSpritePath}");

Someone could fix the problem?

Glyphicons not working

I'm trying to use Glyphicons in my project. But by default they are not working.
I've inspected my application.css and they are imported from "/assets/../fonts/glyphicons-halflings-regular.ttf". But there is nothing in the app at that path.

Is this a bug? Did I do something wrong?

less-rails asset helpers not working

  background: transparent asset-url("edit.png") no-repeat top left;

should translate to:

  background: transparent url("asset/path/edit.png") no-repeat top left;

but it just dumps out the original code

.nav-list .active > a:hover

My nav lists don't style well on the selected item. It seems the rule for .nav-list .active > a:hover is missing...

Not sure how to submit a patch, do I need to compile the less code or just editing the source for .less code would do?

3.0.0-wip support

Hello I made changes to support 3.0.0-wip bootstrap development branch. If you can setup new branch, I'll send you pull request. I forked your repo, renamed and did changes in master branch.

https://github.com/sinfin/less-rails-bootstrap-3 Build Status

If you don't want to maintain this, I can host it in separate repo and update periodicaly bootstrap sources there or just ping me push access to do it here.

Consider incorporating stouset/twitter_bootstrap_form_for

After having used less-rails-bootstrap, it struck me that the one difficult part remaining to incorporate Twitter Bootstrap is form styling. Rendering somewhat complex markup like Twitter Bootstrap expects is a PITA, especially when you start having to handle styling for fields with errors.

Because of this, I took an earlier project of mine and adapted it to Twitter Bootstrap. It has a nice DSL to wrap form building, and outputs Bootstrap-compliant markup in all cases I could identify. And thus twitter_bootstrap_form_for was born.

We may want to consider merging these two codebases into one larger project, to provide an all-in-one plugin for developers wanting to use Twitter Bootstrap.

Thanks!

How to customize bootstrap values?

Hello there. First of all thanks for the gem, it's lifesaver!
My question may seem stupid, but... How can I customize the twitter variables?

I can't find the file anywhere in the project.
Obviously if I override them after the @import 'twitter/bootstrap' all the other rules have already been defined so they will not get the new values.
Same thing if I do the redeclaration before the import, because those values will be changed by the bootstrap files.

Are the bootstrap files hidden somewhere or have I to do some hack like a custom stylesheet where I import first the original version and then my custom values of each bootstrap .less files?

Example
/* custom-twitter-bootstrap.css.less */
@import 'twitter/bootstrap/reset';

@import 'twitter/bootstrap/variables'
@import 'custom-twitter-bootstrap-variables'

@import 'twitter/bootstrap/mixins'
// Override just the @radius default value
.border-radius(@radius: 3px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}

Please forgive me if this seems stupid by I am really new with rails.

less-rails-bootstrap won't run on Rails 3.2.0.rc1

Here's the error I get when I try running bundle

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    less-rails-bootstrap (~> 1.4.1) ruby depends on
      actionpack (~> 3.1.1) ruby

    rails (= 3.2.0.rc1) ruby depends on
      actionpack (3.2.0.rc1)

Overriding variables not possible when importing responsive styles

As two others mention here (metaskills/less-rails-bootstrap-test#4) sometimes it's not possible to override pre-set variables (link @linkColor).

I observed this only happens when I import the responsive styles:

@import "twitter/bootstrap/responsive";

The reason for this behavior can be found here: https://github.com/twitter/bootstrap/blob/master/less/responsive.less#L21
Bootstraps responsive.less imports the variables and mixins itself, so it over-overrides everything you declare in you custom-sheets.

I don't see a quick solution for this at the moment, but perhaps someone else does.

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.