On Monday 2015-02-02 11:27 -0800, paul.ir...@gmail.com wrote: > Hey Mats, the use cases are not obvious to me, but I didn't follow the > original www-style threads on this so I'm lacking context. (A the spec > doesn't help either) > > Can you help explain why a developer would use `display:contents`? > > I think it'd help to have it described a bit. Thanks!
The key use case is being able to work with CSS layout systems that aren't transparent to extra elements in the markup (as block and inline layout mostly are) without being forced to remove elements from the markup. This is important with systems like flexbox and (particularly) grid. So it's not about being able to do things that you can't otherwise do. All the things that are doable with display:contents could be done before. It's just about being able to do those things without deleting "extra" elements from the markup in order to make the tree conform to what the CSS layout model expects. Since what it does is essentially delete an element from the tree as far as CSS is concerned, while leaving its children; that is, you stop displaying the element but still display its contents. Put another way, it's half of display:none without the other half (where display:none is, likewise, a feature that doesn't add any capabilities not present in other ways). -David -- π L. David Baron http://dbaron.org/ π π’ Mozilla https://www.mozilla.org/ π Before I built a wall I'd ask to know What I was walling in or walling out, And to whom I was like to give offense. - Robert Frost, Mending Wall (1914)
signature.asc
Description: Digital signature
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform