-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use 2sp indents in sample YAML files #379
Comments
Hi Paul! You're absolutely right, for our house styles the spaces add up quickly. Here are my three cents:
I could see converting the house styles, although I don't know that our "import" feature works with differently spaced indents… @bcamper ? |
@nvkelso what's your feedback? I agree that deeply nested rules can be difficult to read (and when creating this syntax I'm not sure I expected the nesting to go this deep! :) I have also thought of supporting alternative syntax like dot notation (could be backwards compatible). For example:
This is flatter which helps with deep nesting and can provide better local context as to the layer's parent tree, but it loses some of the spatial indication of hierarchy/inheritance. (An editor like Tangram Play can also provide context of the currently highlighted layer by walking up the tree.) |
Probably a good idea? Is it a file size concern or about legibility? (I think ZIP packaging addresses the file size.)
|
I can see the dot syntax being super helpful for styling layer overrides (in an import context), but I'm not sure I'd write most the basic house styles that way.
|
I like 2 spaces! It's really a matter of personal preference though - YAML can be indented with any number of spaces or tabs, even with different amounts within the same document. That "dot notation" syntax is very reminiscent of TOML :) However it raises a number of semantic questions and I don't think it could be strictly backwards compatible. The |
You could do this with YAML anchors and alises. Personally I prefer the structure in the indents and only use anchors and alises to reduce duplication.
Purely legibility. |
This isn't an issue with tangrams/tangram per se, but with the examples.
Most of the tangram examples use 4sp per YAML indent. After working fairly extensively with deeply indented YAML, I believe it is worth considering moving to 2sp per indent.
As it is, a fair amount of the line is used by the indentation.
I'd be willing to do a PR, except this touches multiple repos so I wanted comments first.
The text was updated successfully, but these errors were encountered: