[Mapcss] Stacked rules question

Richard Fairhurst richard at systemeD.net
Wed Jul 7 10:05:31 BST 2010


Sebastian Spaeth wrote:

> [things about z-index]

Well, the z-index inheritance stuff is probably the thing I got most  
wrong with the original spec. :)

Both Komzpa and Sebastian K have queried how it's meant to work.  
Basically, it's not really clear from the original. So the best thing  
we could do for 0.2 is sort this out.

My current thinking is that we start with:
   way[highway=footway]::highlight  { width: 3; z-index: 2; }
   way[highway=footway]::centreline { width: 2; z-index: 3; }
   way[highway=footway]::centreline { color: green; }

In other words, you can define a new stroke(/fill) using the CSS  
subpart (double colon) syntax. Here we have two strokes. One  
(highlight) is width 3, z-index 2, green; the other (centreline) is  
width 2, -index 3, green.

We then have to decide how to 'stack' a subsequent rule to apply to  
all of them.

Let's say we want to apply opacity 0.5 to all the ways above. Should we say
   way[highway=footway] { opacity: 0.5; }
with the rule that "if no subpart is specified, it applies to all subparts"?

Or should we say
   way[highway=footway]::* { opacity: 0.5; }
instead?

I'm tempted towards the latter. It would be simple for both stylesheet  
authors and implementers in that
   way[highway=footway] {...}
could then be said to equate to
   way[highway=footway]::__unnamed__ {...}
(i.e. a distinct subpart, rather than all subparts that exist already  
and might exist in the future)

But given that I fouled up the original spec I'm not qualified to  
judge on my own. :) So, comments and suggestions welcome.

cheers
Richard





More information about the Mapcss mailing list