Question

[ ANSWERED: the carto.css compiler does not support this feature of less.css]

I'm making a stylesheet for TileMill that will be processed with Carto (an extension of less.css). In other words, I'm making a stylesheet with LESS that uses some custom syntax.

I have a lists of selectors assigned to variables as strings, like so:

@water: "[natural='water'], [waterway='river'], [waterway='stream'], [waterway='waterfall'], [waterway='canal'], [landuse='reservoir'], [landuse='basin'], [amenity='pool'], [amenity='swimming_pool'], [amenity='fountain']"; 

@dirt: "[natural='beach'], [natural='sand'], [natural='scree'], [landuse='bedrock outcrop'], [landuse='quarry'], [natural='land'], [amenity='track']";

I want to be able to use these as selectors in my style sheet, more or less like this (which doesn't work):

(~'@{water}') { polygon-fill: #bbb; }

What I want to end up in my stylesheet is this:

[natural='water'], [waterway='river'], [waterway='stream'], [waterway='waterfall'], [waterway='canal'], [landuse='reservoir'], [landuse='basin'], [amenity='pool'], [amenity='swimming_pool'], [amenity='fountain']{ polygon-fill: #bbb; }

And I'm hoping there's a way to join selector groups, like this:

@water, @dirt { polygon-fill: #bbb; }

Thanks for any advice.

Était-ce utile?
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top