Re: inline-block whitespace collapse

On 10/22/2014 02:12 PM, Tab Atkins Jr. wrote:
> On Wed, Oct 22, 2014 at 10:28 AM, Karen Menezes <karen.menezes@gmail.com> wrote:
>> Hi!
>>
>> Wished to inquire about white space collapse for inline-block.
>>
>> IMHO, inline block for layouting has several advantages over floats. I
>> understand flexbox will suffice in some cases, but it would be awesome to
>> have some control over the whitespace when inline-block just works.
>>
>> I generally use it when I have an unordered list, since it's not mandatory
>> to have closing <li> tags in HTML5. I find this the cleanest of all the
>> awful hacks to overcome whitespace between inline-block elements..
>>
>> Was wondering about the status of this link?
>> Is this something really far away in the future? The link indicates so.
>> http://dev.w3.org/csswg/css-text-4/#white-space-collapsing
>
> That link is indeed the plan for handling this.  Whether it's far in
> the future or not depends entirely on browsers' willingness to
> implement it.

Not entirely. Issue 8 listed there is a real problem.
   # It's been pointed out that ‘trim-inner’, ‘consume-before’, and
   # ‘consume-after’ won't work well because ‘text-space-collapse’
   # is inherited, meaning that inserting a <span> or <div> would
   # cause more white space to be removed than otherwise.

We'll probably have to split the functionality into two properties:
one inherited, one non-inherited.

~fantasai

Received on Wednesday, 22 October 2014 18:42:16 UTC