Use css classes properly #1476
Comments
Author: dev.osm[at]hughbris.com If we are talking about the same thing, I was just working at this last night. Have been stewing on it for ages! I have, for example, in z17:
and have changed its rule invocation to, e.g.:
Is this what you're talking about? |
Author: bob[at]cakebox.net Replying to [comment:1 dev.osm[at]hughbris.com]:
I'm not quite sure, but I have a feeling it's a different thing. If you show me some of your implementation I could probably make a better guess... |
Author: dev.osm[at]hughbris.com
I think so too now. I think we may be trying to solve the same problem in incompatible ways. We probably both grimaced at those hiphenated classnames.
I thought I did that with the code snippets I provided. It's taking quite some time to come up with just one file for zoom17, but I'll put it in a branch when ready for you to see. About 2/3 through now. It's very tedious. It will need very careful testing (hence http://trac.openstreetmap.org/ticket/1481) before I'd be merging it into the main branch. My edit began before your patch for TimBL, so it will need trivial merging. Back to what I'm doing: I'm using classes like tags or properties, exploiting the possibilities of applying more than one (classes are defined in the DTD as NMTOKENS - a list of tokens). This is the way class combinations should be implemented. I think your solution, if I follow it, may not scale as well (only two levels) and will (perhaps) be less readable. It's also a kind of new solution where well-planned multiple classes already do it fine. Anyway, will let you know. If you think your idea is better, I'll start a new ticket. |
Author: dev.osm[at]hughbris.com I don't know what I was looking at by saying I was 2/3 through level 17. Not really. It's going to take a long time to do what I was going to do. I think it has less structural effect than your implementation, though. So while I will put up something to demonstrate the idea, I am wondering whether to hand back this ticket and start my own, take it over, or mark it wontfix. I am pretty sure both implementations can't happen. Here, while you think about it, is another example of style madness: class="highway-casing highway-bridleway-casing highway-bridleway-area-casing no-bezier" .. which could be expressed as class="highway bridleway area casing no-bezier" and the CSS would contain a lot less redundancy, too (e.g. styles that apply to all highways). Can we go on expecting developers to work with this? Sorry, I'm being obstinate. Would be keen to hear your thoughts. I am going to first distract myself by adding rendering for a few new features :~) |
Author: bob[at]cakebox.net Replying to [comment:4 dev.osm[at]hughbris.com]:
This sounds like something that could very well be done a little bit at a time, that would help make sure you don't get into merging hell too. I don't see anything to indicate both ideas couldn't co-exist. Maybe you should just take over this ticket (since this is where we have discussed this) and my idea can be moved to another.
That would be a lot better. I think my idea will coexist well with this though, since that would result in that line being only class="bridleway", since highway, area and casing are shared with many rules in the same area of the stylesheet. |
Author: bob[at]cakebox.net I'm letting this ticket be about your idea, I'll open a new one about mine. |
Author: dev.osm[at]hughbris.com Replying to [comment:6 bob[at]cakebox.net]:
Thanks - just to provide a progress report on this one, I have a difference in the bitmaps converted from the renderings for the comprehensive.osm test data. It's not as trivial to track down as I hoped. Probably a copy-paste error. :~) On the positive side, I can see how I might be able to write a simple test script in bash or python, which will hopefully speed me up to more regular commits. ATM it's a series of hardcoded commands with filename arguments, but I should be able to change this to loop through the testdata directory. |
Author: iandees Cleaning aging tickets. |
Reporter: bob[at]cakebox.net
[Submitted to the original trac issue database at 1.03pm, Sunday, 11th January 2009]
Something that could, if it's possible, help us simplify the stylesheets a bit:
<rule ...>
<rule ...>
Possible implementation: Have the rule engine picks up the commands and trickle the classes down through the template calls.
I don't have time to do this now, but may do so in the future. If anybody else wants to, then feel free.
The text was updated successfully, but these errors were encountered: