Re: [css3-content] ::outside future

On 6/8/10 8:28 AM, Paul Duffin wrote:
> In terms of my use case I want to use it to create multiple borders around a single element without modifying the markup. e.g.

This may be better served by something like -moz-border-colors...

> .item {
>      border: thin solid red; padding: 1px; background: gray; border-radius: 2px;
>      width: 90px; box-sizing: border-box
> }
> .item::outside {
>      display: block;
>      border: thin solid green; padding: 2px; background: white; border-radius: 3px
> }
> .item::outside(2) {
>      display: block;
>      border: thin solid black; padding: 3px; background: blue; border-radius: 4px
> }
> <div class="item">Item</div>
>
> Which would look something like the attached file "outside.png".
>
> XBL would be massive overkill for this.

So would ::outside, from a browser implementor point of view, fwiw.  ;)

> As far as the cascade goes I cannot see what the problem is, assuming that cascade is as defined in http://www.w3.org/TR/CSS2/cascade.html#cascade. The ::outside pseudo element behaves like every other pseudo element and inherits from its superior parent.

Does it, though?  And does the "kid" of the ::outside inherit from the 
::outside?  If so, then someone adding ::outside selectors will cause 
inheritance on the kid to break.  If not, then inheritance for the kid 
is just really weird to start with.  Either way, the behavior is very 
complicated.

Note that even in your example if the ::outside inherits from the 
::outside(2) then just using ::outside(2) automatically changes the 
styling on the ::outside, which is not desirable.

> * What is the future of ::outside?
> * What are the main use cases?

Good questions.

-Boris

Received on Tuesday, 8 June 2010 12:54:06 UTC