mapbox/tilemill — Issue #957: Color-manipulation-like functions for zoom-based width
Author: IvanSanchez
Created: 2011-11-28 15:38:17+00:00
State: open

Wishlist item.

We all love ```lighten(@color,10%)``` and ```darken(@color,10%)```, and the rest of the color manipulation functions. They make our stylesheets compact and easy to modify.

Now, wouldn't it be cool if we could replace this snippet (taken from the Open Streets style)...

```css
.water-outline[zoom>11] {
line-color:darken(@water,10);
[zoom=12] { line-width:0.8; }
[zoom=13] { line-width:1.2; }
[zoom=14] { line-width:1.4; }
[zoom=15] { line-width:1.6; }
[zoom=16] { line-width:1.8; }
[zoom>16] { line-width:2; }
}
```

... with something like this?

```css
.water-outline[zoom>11] {
line-color:darken(@water,10);
line-width:linearzoom(12, 0.8, 17, 2);
}
```

I'm thinking about stuff like cuadratic-zoom width values, and providing values for dash arrays, text size/displacement, and the color spin functions.