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

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.

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

~TJ

Received on Tuesday, 14 April 2015 22:50:39 UTC