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

.dl-horizontal with empty <dd> is not working #12753

Closed
dairiki opened this issue Feb 16, 2014 · 8 comments
Closed

.dl-horizontal with empty <dd> is not working #12753

dairiki opened this issue Feb 16, 2014 · 8 comments
Labels
Milestone

Comments

@dairiki
Copy link

dairiki commented Feb 16, 2014

The &:extend(.clearfix all) on .dl-horizontal dd (line 209 of type.less) does not seem to be working. I.e. the dds are not getting clearfixed, with the result that if a <dd> is empty, the <dd>s from the subsequent row will move up, being displayed in place of the empty <dd>.

This appears to have become an issue with 3.1.0 when .clearfix() was replaced with &:extend(.clearfix all) (in 0016c17).
(Perhaps this, at its root, is a lessc bug having to do with extends within media queries?)

A demo of the problem is at http://jsbin.com/codam/1. (Note that bar def should be displayed on the same "row" as Bar, but instead it is displayed next to Foo.)

Updated: Fixed link to commit 0016c17

@cvrebert cvrebert added this to the v3.2.0 milestone Feb 16, 2014
@cvrebert cvrebert added the css label Feb 16, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Feb 16, 2014

Yeah, it looks like it is a LESS bug, as this example works perfectly fine.

@dairiki
Copy link
Author

dairiki commented Feb 16, 2014

Upon further reading of the LESS docs, this looks to be a documented behavior of lessc. See Scoping / Extend Inside @media where it says “Extend written inside a media declaration should match only selectors inside the same media declaration”.

So lessc is behaving correctly; this is a bootstrap bug.

One fix would be to revert the &:extend(.clearfix all) back to the old-fashioned .clearfix() in this one case.

@hnrch02
Copy link
Collaborator

hnrch02 commented Feb 16, 2014

Ah, I see, should've at least flipped through the LESS documentation 😄
Your proposed solution sounds good, are you planning on opening a PR?

@dairiki
Copy link
Author

dairiki commented Feb 16, 2014

Ah, I see, should've at least flipped through the LESS documentation

Yes, so should”ve I, before filing the initial ticket!

Sure. I'll create a PR.

dairiki added a commit to dairiki/bootstrap that referenced this issue Feb 16, 2014
Less' :extend, when used inside a @media declaration, only matches
selectors inside the same @media declaration.  Because of this,
`.dl-horizontal dd` was not getting the `.clearfix` styles.
@dairiki
Copy link
Author

dairiki commented Feb 16, 2014

PR #12756 created.

@dairiki
Copy link
Author

dairiki commented Feb 22, 2014

Fixed in b99be29. Closing.

@dairiki dairiki closed this as completed Feb 22, 2014
@mdo
Copy link
Member

mdo commented Feb 22, 2014

<3 thanks!

@cvrebert
Copy link
Collaborator

(Note for self and future readers: None of the other clearfix inclusions that were changed to use extend were inside media queries, so no need to worry about other components in that commit being affected by the same problem.)

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

4 participants