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

1.4.0 Failing to compile Bootstrap? #1231

Closed
leeola opened this issue Mar 18, 2013 · 11 comments
Closed

1.4.0 Failing to compile Bootstrap? #1231

leeola opened this issue Mar 18, 2013 · 11 comments

Comments

@leeola
Copy link

leeola commented Mar 18, 2013

So, i did a comparison test between 1.3.3 vs 1.4.0 to compile bootstrap.less. 1.4.0 is causing some NaN output silently. Eg:

.row-fluid .span12 {
  width: (NaN% * 12) + (NaN% * (12 - 1));
  *width: (NaN% * 12) + (NaN% * (12 - 1)) - (0.5 / (12 * 60px) + (20px * (12 - 1)) * 100 * 1%);
}
.row-fluid .offset12 {
  margin-left: (NaN% * 12) + (NaN% * (12 - 1)) + (NaN%*2);
  *margin-left: (NaN% * 12) + (NaN% * (12 - 1)) - (0.5 / (12 * 60px) + (20px * (12 - 1)) * 100 * 1%) + (NaN%*2) - (0.5 / (12 * 60px) + (20px * (12 - 1)) * 100 * 1%);
}
.row-fluid .offset12:first-child {
  margin-left: (NaN% * 12) + (NaN% * (12 - 1)) + (NaN%);
  *margin-left: (NaN% * 12) + (NaN% * (12 - 1)) - (0.5 / (12 * 60px) + (20px * (12 - 1)) * 100 * 1%) + NaN% - (0.5 / (12 * 60px) + (20px * (12 - 1)) * 100 * 1%);
}

Now, I am assuming this is due to the calculation changes, and possibly isn't even a "bug". I am wondering though, that if this is intended, is there an easy fix for this? Ideally one where i don't have to go through and patch the entire bootstrap codebase (of which i am very unfamiliar hah).

If it's a complicated fix for Bootstrap, i'll look at using the outputted css file, and wait for Bootstrap to eventually update to 1.4.0. Not sure when/if that is planned though.

@jonschlinkert
Copy link
Contributor

Thanks for reporting this. I don't think it's the calculation changes, it looks like a strict units error (see the third bullet down in the changelog). Try compiling with --strict-units-off in lessc.

Also, so we can better address future questions about this, what version of bootstrap are you using?

Also it might be worth trying less-tests to track down where errors are coming from.

@leeola
Copy link
Author

leeola commented Mar 18, 2013

I was trying this with Bootstrap 2.3.1 (currently master @ https://github.com/twitter/bootstrap)

@leeola
Copy link
Author

leeola commented Mar 18, 2013

@jonschlinkert Also, i tried with --strict-units-off (and -su) with no success. NaN is still being outputted from the results.

@jonschlinkert
Copy link
Contributor

Actually you are missing the outter parens:

margin-left: ((NaN% * 12) + (NaN% * (12 - 1)) + (NaN%));

@leeola
Copy link
Author

leeola commented Mar 18, 2013

Well i'm not, Bootstrap is (if that is indeed the issue). Though, i'm looking through the less files now, still not sure where exactly the quotes code is being generated.

@jonschlinkert
Copy link
Contributor

You're correct it's Bootstrap that is missing the parens. Sorry, I was under the impression that you had access to edit the files.

@lukeapage
Copy link
Member

-su -sm

Need both options on for bootstrap 2.3.1

Bootstrap 3 will work without options.

@leeola
Copy link
Author

leeola commented Mar 18, 2013

Bootstrap 3 will work without options.

Good to know!

@lukeapage
Copy link
Member

Can you confirm 2.3.1 works with strict maths off and strict units off ?

@leeola
Copy link
Author

leeola commented Mar 18, 2013

I believe it does!

So now i need to add those options to my grunt-contrib-less branch.

@lukeapage
Copy link
Member

cool, I'm sure a pull request to master would be appreciated.

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

No branches or pull requests

3 participants