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

Sass variables removed in version 4? #19877

Closed
benwiley4000 opened this issue May 10, 2016 · 6 comments
Closed

Sass variables removed in version 4? #19877

benwiley4000 opened this issue May 10, 2016 · 6 comments
Labels

Comments

@benwiley4000
Copy link

Without knowing a lot about Bootstrap (I'm diving straight into version 4), I'm working with a theme that relies on Bootstrap 3 - I'm trying to put Bootstrap 4 in instead. This particular module wants to use a few variables that aren't around anymore -- $line-height-computed, $screen-sm-min, $navbar-height.

Could anyone explain why those are no longer required by Bootstrap itself and whether I should compute these variables myself or use a replacement variable from the new styles?

@cvrebert
Copy link
Collaborator

@niftylettuce
Copy link

Any update on this?

@niftylettuce
Copy link

It looks like $line-height-computed was removed in v4. @mdo @cvrebert do we need to add this back?

V3 at https://github.com/twbs/bootstrap/blob/v3.3.7/less/variables.less#L62-L65:

//** Unit-less `line-height` for use in components like buttons.
@line-height-base:        1.428571429; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
@line-height-computed:    floor((@font-size-base * @line-height-base)); // ~20px

V4 at https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.3/scss/_variables.scss#L174:

$line-height-base: 1.5 !default;

@cvrebert
Copy link
Collaborator

The most helpful thing to do would be to look thru the git history and find which commit removed the variable.

@bardiharborow
Copy link
Member

@cvrebert, I suspect you're looking for ed89be1. (git bisect is amazing.)

@mdo
Copy link
Member

mdo commented Oct 28, 2016

I removed the computed line-height as I don't really need it anymore for setting vertical spacing between elements (e.g., at the bottom of an alert or between headings). Those things are mostly better left to the margin utilities, type scale, etc.

All the screen sizes and what not were redone in v4, so no surprise the $screen- vars are gone.

And I've removed, wherever possible, fixed-height values and variables. They are flimsy for creating complex components, are often the result of complex math, etc.

Sorry for the super delayed response!

@mdo mdo closed this as completed Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants