-
Notifications
You must be signed in to change notification settings - Fork 38
conditional defaults #402
Comments
Yes, if these cases are necessary we should record them in the spec somehow. |
@lucaswoj you've been working on a lot of style stuff in -js recently. Any ideas on how this should be implemented? |
I foresee us adding a lot of logic to the style spec in the near future. We should embrace the precedent set by filters and use a lisp-ey syntax. {
"default": ["if", ["==", "symbol-placement", "line"], "point", "line"]
} |
... hopefully this'll dovetail nicely into future data-driven styling features |
#104 (comment) proposes this conditional syntax as an elegant means for supporting token fallbacks via the |
@1ec5 Would the |
It would only be meaningful in relation to properties that deal with sprite names (or URLs once we implement #485). Could we define |
@1ec5 Would a general |
Yes. |
We dealt with this by adding In general, conditional defaults add complexity to the implementation and the mental model required to author styles. We should try not to add more. |
In the renderers we already have different default values for
-rotation-alignment
based on whethersymbol-placement
isline
orpoint
. This isn't specified in the spec, so it doesn't show up in the documentation and it doesn't appear correctly in studio.I think it could be a good idea to have
symbol-avoid-edges
also have a different default for line labels.@jfirebaugh thoughts on how we should/shouldn't do this?
The text was updated successfully, but these errors were encountered: