W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: Question regarding the "all" property

From: Philip Walton <philip@philipwalton.com>
Date: Wed, 23 Jan 2013 12:57:10 -0800
Message-ID: <CAGRhNhXfm4XE3SHE2_gM_KVAqVu8ytKjTRveDMScEy6Z87JoNA@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
Thanks, yeah, I've been following the shadow dom and I'm very excited about
its potential for real style encapsulation.


On Wed, Jan 23, 2013 at 10:36 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Wed, Jan 23, 2013 at 10:09 AM, Philip Walton <philip@philipwalton.com>
> wrote:
> > I'm writing about the new "all" property and I just wanted to make sure
> I'm
> > factually correct on a few points:
> >
> > "all" is just a regular CSS property and all the normal specificity
> rules of
> > the cascade apply, correct?
> >
> > That means that if I've done something like:
> >
> > #sidebar > div { background: red; }
> >
> > Then the following rule, if applied to a <div> in the sidebar will not
> > override the previous background definition.
> >
> > .widget { all: default; }
> >
> > If so, that implies that the all property cannot be used to achieve true
> > encapsulation, it's just a simple way for authors to undo what they've
> > already done (no judgment either way, just checking).
> >
> > Am I'm understanding this correctly?
>
> Yes.  It's just a normal shorthand property, exactly the same as
> 'background' or 'transition' or 'border'.  It just happens to
> shorthand *all* of the properties, rather than a subset.
>
> (For context, since Ms2ger just asked about this in another channel,
> the 'all' property was recently added to the Cascade module:
> <http://dev.w3.org/csswg/css3-cascade/#all-shorthand>.)
>
> Stronger encapsulation requires more powerful concepts than we can get
> with just the cascade, and probably coordination with other
> technologies.  Luckily, precisely that already exists - the Web
> Components spec, which is being implemented in multiple browsers, is
> designed explicitly for this kind of thing, so you can write a widget
> and "hide" its DOM inside of a "shadow", which can't be targeted by
> the outer page's CSS at all unless the component author allows it.
>
> ~TJ
>
Received on Wednesday, 23 January 2013 20:57:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT