Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap 3 #329

Merged
merged 1 commit into from
Sep 9, 2013
Merged

Bootstrap 3 #329

merged 1 commit into from
Sep 9, 2013

Conversation

thomas-mcdonald
Copy link
Member

Bootstrap 3 has RC'ed, so we need to get ready-(ish) to push an update.

gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'

Please comment on issues here rather than in new issues. +1's will be deleted with vengeance. I make no guarantees about the frequency of updates or responses here.

Stuff we have to work on for release:

  • Icon font compatibility with Rails (√) & Compass (?) - modify functions as appropriate
  • Update Compass manifest need to check
  • Update patch script (fixed with new converter)
  • Split docs up
  • Sass compatibility & documentation - manual installation as copy and paste from download as zip
  • move to @twbs

This was referenced Apr 13, 2013
Closed
@thomas-mcdonald
Copy link
Member Author

I imagine that the icon fonts don't work given I've not actually tried to load this in an application yet, this is just a straight Sass conversion that will compile (rake debug/rake test)

@archonic
Copy link

Glad to see a 3.0 branch! Where did _reset.scss go? I'm looking for to get this fix asap:
twbs/bootstrap@86bb3b8

@archonic
Copy link

Got it. It looks like twbs/bootstrap@86bb3b8 isn't a part of this branch yet. I'd like to submit a pull request for taking out width: auto\9; from /vendor/assets/stylesheets/bootstrap/_reset.scss but I still don't see _reset.css in that folder despite that being in the traced style:

/* line 79, /usr/local/rvm/gems/ruby-1.9.2-p180/gems/bootstrap-sass-2.3.1.0/vendor/assets/stylesheets/bootstrap/_reset.scss */
img {
  /* Responsive images (ensure images don't scale beyond their parents) */
  max-width: 100%;
  /* Part 1: Set a maxium relative to the parent */
  width: auto\9;
  /* IE7-8 need help adjusting responsive images */
  height: auto;
  /* Part 2: Scale the height according to the width, otherwise you get stretching */
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}

@glebm
Copy link
Member

glebm commented Apr 18, 2013

Had to do this to make sass helpers work with master sprockets/rails: glebm@25399d4

$font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;

$font-size-base: 14 !default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like px got left out here

@m5o
Copy link

m5o commented May 26, 2013

Hey! Just to know. In jlong/sass-bootstrap-defunct#73 we now started the work on 3.0.0-wip for SASS

@glebm
Copy link
Member

glebm commented May 28, 2013

I've updated the script (incl. patch) and pulled from 3.0.0-wip here #368

@glebm
Copy link
Member

glebm commented May 28, 2013

@m5o That's great, I've updated this repo's script to pull from 3.0.0-wip branch and account for structural changes in that branch!

@thomas-mcdonald
Copy link
Member Author

Things to do/think about:

  • version needs to be defined in code and thus accessible to people (for conditionals, see next)
  • Upgrade from 2.3 -> 3 is massive (whole grid is changed, padding etc). Are we going to package 2.3 inside of the 3 gem to allow engines etc to be backwards compatible? Means the engine could update to 3 and apps could stay on 2.3 or vice versa, version detection will need to be used since the location of 2.3 will be different depending on the gem version installed.

@glebm
Copy link
Member

glebm commented Jun 1, 2013

Interesting, I wonder if we can provide multiple BS versions. One way to do this would be to set sass/javascript load paths in runtime, based on a setting e.g. config.bootstrap_version.

@thomas-mcdonald
Copy link
Member Author

Thought of another thing with the converter (which seems to be failing at the moment) to look into.

I was originally against the idea of #393 but it would make configuring components much easier than at the moment, copying the bootstrap.scss file across always seemed a little hacky.

@GantMan
Copy link

GantMan commented Jul 30, 2013

Sorry to sound terribly ignorant, but I'm trying to move from Bootstrap 2 to Bootstrap 3, the docs aren't very clear and rake -T doesn't show the conversion rake task mentioned, nor does the upstream converter command on the readme work. I'm at a loss on how to move my project to Bootstrap 3 from this gem.

@glebm
Copy link
Member

glebm commented Jul 30, 2013

@GantMan The conversion task is for the gem's internal use -- it converts bootstrap LESS to SASS.

You can try it out with:

gem 'bootstrap-sass', git: 'https://github.com/thomas-mcdonald/bootstrap-sass', branch: '3'

and manually convert all your markup and customizations; note that bootstrap-sass support for this is still very alpha -- no stable release yet.

@glebm
Copy link
Member

glebm commented Jul 30, 2013

@sporkd, I see, could you please push a fix -- I am not sure what the $parent hack refers to
Could you also review my converter: commits? Thanks!

@glebm
Copy link
Member

glebm commented Jul 30, 2013

At the moment there is a lot of manual patching that needs to happen after each convert[].
How can we automate the converter further?
It'd be great if it is 100% like before, but it looks we will need some kind of patches. Formatting-insensitive search & replace patcher sounds good enough. What do you guys think?

@AJ-Acevedo
Copy link
Contributor

@m5o Just updated sass-twitter-bootstrap to Bootstrap 3.0 RC1

@sporkd
Copy link
Contributor

sporkd commented Jul 31, 2013

@AJ-Acevedo We're actually ahead of sass-twitter-bootstrap conversion.

@AJ-Acevedo
Copy link
Contributor

Awesome! Thanks for the heads up! I'll be rolling it into my project tonight!

@pongstr
Copy link

pongstr commented Jul 31, 2013

👍 thanks for this!

@glebm
Copy link
Member

glebm commented Jul 31, 2013

Getting close with the converter

rake convert[3.0.0-wip] && git diff --numstat

@m5o
Copy link

m5o commented Aug 1, 2013

found a minor converter bug in _forms.scss: Line 79-L80

spin should here not be converted to adjust-hue

@glebm
Copy link
Member

glebm commented Aug 1, 2013

@m5o Thanks, fixed!

@glebm
Copy link
Member

glebm commented Aug 3, 2013

Converter does everything at this point (i.e. rake convert[3.0.0-wip] gives empty diff)
Doing structural transformations with regexes sucks but it kind of works with just a few StringScanner kludges (only when it's this simple)

@sporkd
Copy link
Contributor

sporkd commented Aug 3, 2013

Dude, that's awesome. Nice work! Wasn't sure if we could ever get to 100%. Of course things could still change, but hopefully as 3.0 stabilizes, the converter shouldn't require too much tweaking.

I was also thinking it would be nice if we had a test to compare the output css for equality with the official bootstrap.css. However this might be very difficult considering the various ways css can be output and still be equal in result. Perhaps something like Nokogiri could be useful.

@glebm
Copy link
Member

glebm commented Aug 3, 2013

Yeah, hopefully it doesn't have too many different new things (some potential for bleeding edge).
Parsing CSS unfortunately can't be done with nokogiri (which only parses XML). There are some css parsing gems though. A simple test we could add too is a bootstrap docs page in a headless browser and asserting equality of every DOM style property of every element VS the original bootstrap...

@glebm
Copy link
Member

glebm commented Aug 5, 2013

Converter output now contains all the non-generic transformations (the new patches) applied, makes it really easy to see what it does now.
I also discovered convert_less_ampersand doesn't affect the output. What does it do? Is it redundant?

@m5o
Copy link

m5o commented Aug 8, 2013

improvement idea
I would suggest to use Variable Arguments in SASS for the box-shadow and transition mixins.
You could also refactor the string interpolation for these two mixins, like we did in our fork month ago.

@thomas-mcdonald
Copy link
Member Author

I was thinking of versioning issues today. If we have 2.3 archived in a bootstrap/2.3 folder, we can solve issues with engines like rails_admin, which can conditionally include a Bootstrap version based off our defined version number - if the application has b-s 3 installed then rails_admin would include bootstrap/2.3/bootstrap, else it would use the previously defined bootstrap/bootstrap.

Of course, if rails_admin upgrades to b-s 3 then anyone wanting to stop on < 3 is kinda SOL, unless they choose to use static files.

edit: just found this - railsadminteam/rails_admin#1716

@glebm
Copy link
Member

glebm commented Aug 21, 2013

New Glyphicons are confirmed working on Rails

They are back

This still needs a custom helper for non-rails (PR welcome!).

@thomas-mcdonald
Copy link
Member Author

This still needs a custom helper for non-rails (PR welcome!).

I was thinking we could just instruct people not on the asset pipeline to override the font variable? It's probably the easiest way, given the various environments people manage to shoehorn this into.

@glebm
Copy link
Member

glebm commented Aug 21, 2013

Do you mean something like this?

in variables

// inject bootstrap-sass var
$twbs-font-url-helper: font-url !default

in glyphicons

src: #{$twbs-font-url-helper}('#{$icon-font-path}#{$icon-font-name}.eot'); 

@glebm
Copy link
Member

glebm commented Aug 21, 2013

I just tried the above in 2b717ee but it doesn't work Invalid CSS after "... format('woff')": expected ";", was ","
The branch is 3-font-helper if anyone knows a way to make it work.

@thomas-mcdonald
Copy link
Member Author

ah. I was thinking of something much simpler, but I just remembered that the webfont has multiple different extensions.

@glebm
Copy link
Member

glebm commented Aug 21, 2013

Turns out it is possible via call in sass 3.3 but not 3.2 like this.
Perhaps patching call in for older sass would be a good solution

@frabrunelle
Copy link

Glyphicons work fine in development but not in production. I get errors that look like:
ActionController::RoutingError (No route matches [GET] "/assets/bootstrap/glyphicons-halflings-regular-24dfb40c91db789b8b8faba6886ac1ef.svg")

@travisdahl
Copy link

after that last update, I can no longer set $grid-gutter-width to a percentage.

Syntax error: Incompatible units: '%' and 'px'.

@glebm
Copy link
Member

glebm commented Aug 22, 2013

@frabrunelle should be fixed with 0e8d41d

@travisdahl you can try overriding these variables, but I don't think percentage gutter is generally supported by twbs

@frabrunelle
Copy link

Thanks @glebm, it works!

@travisdahl
Copy link

Thanks @glebm , that's exactly what I had in my SASS file... $grid-gutter-width:1%; which did in fact work as of last week. Looks like until your last commit. I added a comment to the commit. Thanks for all your hard work!

@glebm
Copy link
Member

glebm commented Aug 22, 2013

See my comment above, if you want this changed you can raise issue with twbs/bootstrap.

@travisdahl
Copy link

@glebm , ah I see. I'll report it over there! Sorry about that!

@wesleycho
Copy link

It looks like the .navbar-collapse class stylings are missing from this branch.

Edit: Nevermind, looks like another gem was conflicting with my attempt to use 3 and was causing all my problems

@umhan35
Copy link

umhan35 commented Aug 26, 2013

With "this is 3.0.1" commit, does it mean the "3" branch is ready for production use and will be merge to master branch soon? @thomas-mcdonald @glebm If not, what's the schedule?

@glebm
Copy link
Member

glebm commented Aug 26, 2013

@umhan35 It just means the commit corresponds to twbs/bootstrap 3.0.1 in progress (unreleased). Whether it's ready for production is in the eye of the beholder: while it does appear to work just fine, we do not have any tests yet. See the checkboxes in the OP: once they are all then we are close.

@kwerle
Copy link

kwerle commented Aug 26, 2013

A rough notion of schedule would be nice. One of:

  • days
  • weeks
  • months

would be lovely.

@glebm
Copy link
Member

glebm commented Aug 26, 2013

On 571ba86 : this commit incorporates some changes and deprecations from BS3.0.1 ship list, it's not actually 3.0.1.

@thomas-mcdonald
Copy link
Member Author

@glebm I'm gonna push the Sass as it was at the v3.0.0 tag, can we leave it at that for this PR, and then I'll spend some time working through the remaining issues as far as I can tell wrt testing, Compass etc.

@glebm
Copy link
Member

glebm commented Aug 28, 2013

@thomas-mcdonald OK, great. I can push further updates to a bleeding-edge branch (latest?). Then merge from that branch into master for releases.


If you have been using this on the bleeding edge before the revert commit, the latest commit ref is:

gem 'bootstrap-sass', 
  git: 'https://github.com/thomas-mcdonald/bootstrap-sass', 
  ref: 'e21b64bb2791f8f564b5ae33c77ecc4e4447c0d0'

@bobbbie
Copy link

bobbbie commented Aug 30, 2013

Hi,

Hope someone can help.. I am using bootstrap-sass but want to upgrade to bootstrap 3 before I continue on mainly doing work on the views. Rather than wait for this to be released, I was hoping I could switch to this branch.

I have changed my Gemfile to point at branch 3 by doing:

gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'

And then ran bundle update and the gem has been updated, however nothing in the repo has changed. And running:

bundle exec rake convert

Produces an error:

Don't know how to build task 'convert'

Can someone let me know what I am missing, please.

@thomas-mcdonald
Copy link
Member Author

You want the Rails install guide

@bobbbie
Copy link

bobbbie commented Aug 30, 2013

Sorry, my fault. When I was first trying it, I only did 'bundle' and not update. Then later I didn't restart the server!

Very sorry, thanks for the reply and the hard work!

Fix typo with loading individual Javascript files.
@thomas-mcdonald thomas-mcdonald merged commit 1344c58 into master Sep 9, 2013
@balaji-chronus
Copy link

I wanted to use bootstrap 3 with bootstrap-sass, couldn't get it even if update my gemfile with the following,
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass', branch: '3'

i want to start fresh and i only get 2.3.2. Please help me on the steps to get bootstrap 3 working with bootstrap-sass.

@jonathanmcw
Copy link

Hi there. I've tried following the hints from bobbbie and still getting the "Don't know how to build task 'convert'" message. I do recon there's this script here and wonder do I have to do something with it in order to get it work? Sorry I'm pretty new in Rails in general. Thanks! :)

@thomas-mcdonald
Copy link
Member Author

Hi Jonathan. You don't need to run the convert task unless you're developing on the gem itself. You probably want the Rails install guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.