On Sat, Jun 2, 2012 at 10:16 AM, Chris Jaure <
chris...@gmail.com> wrote:
> Wow, you poked a bunch of holes in my technique :)
Well, unfortunately, yes. :(
I don't think there's an easy fix here.
> I can reproduce the bugs
> you mentioned. Guess I've got some more work to do.
I did some more testing, and display:table appears to work a tad
better than display:table-cell:
<code>
.unit {
word-wrap: break-word; /* Since we're already using hacks. */
position: relative; /* What are drawbacks? I would not mind. */
}
.ufix4 {
width: auto;
float: none;
display: table;
*display: block; /* IE<8 */
*overflow: visible; /* IE<8 */
*zoom: 1; /* IE<8 */
}
</code>
I've updated my demo page (it's the "Test 4" heading):
<
http://sandbox.hulse.me/oocss.html>
Here are some notes:
* IE6/7 handle this well: Due to word-wrap:break-word style, the
columns shrink and expand very well (surprisingly better than Firefox
12 on OSX.)
* I removed all of the underscore hacks: I think this had to do with
IE5.5's 3px jog bug. That browser is dead and so is my support for it.
:)
* At small widths, these browsers drop the display:table columns:
Firefox 12, IE8, Safari, Opera and Chrome (those are all the ones I
had time to test in). Possible fix: break the cols into 100% widths
using media queries and mobile-first technique.
* Via IE6/7, and not to state the obvious, but overflow:visible does
not clip absolutely positioned child elements.
> Chosen just replaces select elements with something better looking. The root
> problem is the use of position: absolute inside of a parent that's
> positioned relatively; anything that extends beyond a grid unit will get cut
> off. While this has been brought up before, every argument I saw assumed I
> had control over my styles, but in the case of third-party libraries or
> scripts, that isn't the case.
Ahhh, I now understand your predicament. Thanks for clarifying.
Chosen sounds like a cool script. :)
> So it seems fine to use the micro clearfix on .line
Yah, the micro clearfix appears to work well. In fact, using that for
.line means that one can use box shadows and absolute positioned
elements for every col other than .lastCol (that is, if one decides to
keep overflow:hidden technique).
> but we need to find something else for .lastUnit.
Well, I guess it depends on the desired level of browser support. If
one doesn't 't need to worry about IE<8 (or whatever) then more
options are available (i.e. CSS3 stuff and/or
display:table/tabl-row/table-cell, other?)
I personally try to support IE6, so I'll probably stick with this:
<code>
.ufix {
width: auto;
float: none;
display: block;
overflow: hidden; /* This clips box-shadows. :( */
*overflow: visible; /* IE<8 */
*zoom: 1; /* IE<8 */
}
</code>
That's the original .lastUnit class, renamed and the underscore hacks
have been removed.
I might go with display:table though; if I do, I'll be using media
queries to break columns into 100% widths before the .lastUnit drops
below the preceding floated column.
Then again, I can just remember to not put anything important inside
of .lastUnit. :)
More thoughts?
Thanks again!
Cheers,
Micky