-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Multiple input-group-addon support #18500
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
Conversation
1. Invert `:first-child` into `:not(:last-child)` and vice versa 2. Remove double border at the left of `.form-control` 3. Shifts negative margins of `.btn` and `.btn-group` to retain rightmost border when using at the left of `.form-control`.
> .btn, | ||
> .btn-group { | ||
z-index: 2; | ||
margin-left: (-$input-btn-border-width); | ||
margin-left: (-$input-btn-border-width) * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand why you're now doubling here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a see-sawing situation, because the original .input-group-btn
has double borders in your rectangle, while .input-group-addon
does not.
This fix in fact presented an existing issue of double borders in another way, we could limit the PR to one single fix and make another PR for this one. Further on the border issue: I just came up with an alternative approach, look at the end of the file. Basically I use negative left margin to create an overlap on the double borders. But this introduce a counter-overlap when the mouse cursor hovers on a @include hover-focus-active {
z-index: 3;
} At this point we are back to the original style, with the double border in The second fix is specifically for |
Your "alternative approach" sounds reasonable to me. |
After a some crunching I merged two fix into a more simple one, see this plunk. Gist is also updated to reflect the change. It does the work way better than the previous attempts. |
@cvrebert I could use your comment regarding the negative margin fix. |
CC: @mdo |
@cvrebert @mdo More on this, it is in fact Webkit who make this ugly. Namely Chrome 47.0 and Safari 9.0.1, if you horizontally resize the browser you'll notice the double border only occurs when viewport width is with pixels in odd numbers, while even numbers will render normally without issue. Tested in Firefox 40.0.3 it renders no double borders at all. |
You might be describing https://code.google.com/p/chromium/issues/detail?id=534750 and its WebKit cousin. |
@cvrebert If we're gonna let google fix that, the current commit is good enough to merge. |
Merged and added docs example in 9c3ba54. |
Patch remade from
v4-dev
.Fixes #17927, see this plunker for a live demo.