W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: [css3-content] Replacing ::outside with ::inside

From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Sun, 12 Apr 2009 18:46:06 +0200
Message-ID: <65307430904120946i3d5b2bb3q19070fe699ad9098@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style <www-style@w3.org>
2009/4/11 Tab Atkins Jr. <jackalmage@gmail.com>:
> On Sat, Apr 11, 2009 at 12:39 PM, Giovanni Campagna
> <scampa.giovanni@gmail.com> wrote:
>> -- background --
>> This proposal crossed my mind while talking with Tab Atkins about
>> ::slot in Template Layout. He wanted to allow margins, and to make
>> those margins not collapse (sort of "box-sizing:margin-box"). I didn't
>> like the idea, but I did think that allowing some space between
>> adjacient slots and their borders may be useful. But I thought that
>> this kind of space is not a margin, but rather a padding (because it
>> is all around the box and doesn't collapse).
>> Ok then, how to specify an external padding? You need two boxes, one
>> inside the other.
>> I said to myself: I need the Generated Content features... but what
>> does ::slot()::outside mean? How shall I specify "display:slot"?
>> This didn't look very good to me
>> -- the current situation --
>> The Generated and Replaced Content Module introduces the ::outside
>> pseudo-elements, which wraps its superior parent and all its (in flow)
>> content. This pseudo-element is not implemented in any UA I tested. In
>> addition, it creates a lot of difficulty on the author side, because
>> the wrapping generated box still inherits (like every other
>> pseudo-element) from its superior parent.
>> -- my proposal --
>> Drop ::outside.
>> Add ::inside, a pseudo-element wrapping all superior parent's content
>> (but not ::before, ::after, ::alternate or other pseudo-elements). All
>> properties apply to this pseudo-element (but their meaning is changed,
>> because it is inside its superior parent like a nested <div>)
>> This way, to add multiple borders to an element, you say:
>> .multiple {
>> border:1px solid yellow;
>> }
>> .multiple::inside {
>> border:1px solid blue;
>> }
>> .multiple::inside::inside {
>> border:1px solid red;
>> }
>> We may introduce the syntax shorthand "::inside(n)".
>> Not generated ::inside elements are removed, ie if ::inside::inside is
>> never referenced, ::inside::inside::inside is the same as
>> ::inside::inside.
>> -- use cases --
>> All of ::outside, plus those case when an appropriate ::outside is not
>> available, like for example ::slot.
> How do margins on an ::inside pseudoelement interact with margins of
> the superior parent, and of children elements?

I think that the ::inside should be treated as an anonymous <div>, in
all respects, including collapsing of margins.

> ~TJ
Received on Sunday, 12 April 2009 16:46:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:35 UTC