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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 11 Apr 2009 15:12:36 -0500
Message-ID: <dd0fbad0904111312r36b17babva5a5487cc8923998@mail.gmail.com>
To: Giovanni Campagna <scampa.giovanni@gmail.com>
Cc: www-style <www-style@w3.org>
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?

~TJ
Received on Saturday, 11 April 2009 20:13:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT