-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
input-size is generating different CSS than I would expect #15074
Comments
This jsbin shows the bug: http://jsbin.com/nomobegivu/1/edit?html,css,output The |
I don't think the LESS fix works, but I could be mistaken. The resulting CSS I get is: I expected: The issue seems to be in the mixin as its pre-pending the selector. The selector is pre-pended even if the classes are nested. See this LESS example here: Not sure of the fix as I played with it a bit, but by no means am I a LESS expert. |
Agreed, the nonsensical selectors are still present after the "fix": |
This is how I got it to work without changing the mixin: .form-group-sm .form-control
{
&:extend(.input-sm);
}
.form-group-sm select.form-control
{
&:extend(select.input-sm);
}
.form-group-sm select[multiple].form-control
{
&:extend(select[multiple].input-sm);
}
.form-group-sm textarea.form-control
{
&:extend(textarea.input-sm);
} Do the same for lg styles. Not very elegant and a little verbose, but because of how the mixins written I don't think there are a lot of options. |
I'm using bootstrap-sass and in that version control sizing doesn't work (e.g. form-group-sm or form-group-lg etc, see twbs/bootstrap-sass#763)
Looking into what is causing this led me to the Less version of bootstrap, and I think something is wrong with the
input-size
mixin and how it's being used. While the Sass version is broken, and I think the Less version works, I believe the Less version isn't generating the intended CSS.The less code from forms.less (https://github.com/twbs/bootstrap/blob/master/less/forms.less#L315):
Generates this CSS code:
That doesn't look like the intended CSS. I would expect this:
Is this wrong? I would be interested in trying to create a patch if it is.
-Caleb
The text was updated successfully, but these errors were encountered: