I wanted to check if I could use something like the CSS var() function with the GeoServer CSS plugin styles.
Something to look like:
:root {
--land-color: #f2efe9;
}
/* @title Land */
[featurecla = 'Land'] {
background-color: var(land-color);
}
Except obviously for more than one variable.
I came across GeoServer CSS Styling variable but could not get the only suggested solution there to work.
This is what I tried:
/* &env=land-color:#dd0000 */
/* @title Land */
[featurecla = 'Land'] {
fill: env('land-color');
stroke: #f2efe9;
}
The result I want to get is setting a color (or any other style variable, like halo-radius or font-size) once and the use it by name in entire stylesheet, making it easier to edit it across the document.
I keep getting a default white polygon with black stroke when using this. The CSS validates properly but does nothing.