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

Re: Would it be possible to have a 'previous' keyword for things like multiple background images...

From: Sebastian Zartner <sebastianzartner@gmail.com>
Date: Mon, 20 Apr 2015 08:23:32 +0200
Message-ID: <CAERejNbLy2ePXww9+m+c4DJuQ_Z6SpA2694Mai2E-EGPzNje3Q@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "David O'Sullivan" <mail@david-osullivan.co.uk>, www-style list <www-style@w3.org>
On 15 April 2015 at 00:49, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>
> On Mon, Apr 13, 2015 at 6:23 AM, David O'Sullivan
> <mail@david-osullivan.co.uk> wrote:
> >
> > This is my first submission so apologies if I am not doing it right!
> >
> > Anyway my query/proposal is this:
> >
> > Would it be possible to have a 'previous' keyword for things like multiple background images so that overriding rules can use the ‘previous’ setting from a previous rule and only override what is explicitly set in the overriding rule?
>
> The way we're intending to do this (someday) is to make all
> list-valued properties (properties that accept a list of identical
> things, like background or box-shadow) be shorthands with numbered
> longhands.  This way your example would be:
>
> ```
> .myelement {
>   background-image: url(someimageurl2), url(someotherimageurl2);
> }
> .my-element.special {
>   background-image-2: url(someNEWotherimageurl);
> }
> ```
>
> So you'd only override the second url() from the first rule.

If you're willing to change the syntax for property names, this could
also be expressed by using square brackets to indicate an array index
like in other languages. This syntax would clarify that it's something
special and would avoid conflicts if the W3C ever decided to use the
number suffix for something else. So the result would be this:

> While I haven't fully convinced the WG to accept this yet, I think it's only a matter of time. ^_^

Why is the WG reluctant? Can you point to the related discussions?

Sebastian
Received on Monday, 20 April 2015 06:24:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC