-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Make requirements for text offset props more precise #8418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dereklieu Thanks for this PR!
Based on your changes, text-variable-anchor
will now be documented as:
And text-anchor
as:
The docs should be clear as to which of these properties will take precedence and be applied in the event that both are present. In symbol_layout.js
text-variable-anchor
is given precedence if found on the layer style.
@asheemmamoowala that's a great point. Is precedence of one property over another something that is the responsibility of the style spec to communicate? If not, what are next steps to making sure the docs reflect this? |
Should this PR target publisher-production or does it relate to changes only in master, not yet part of a release? |
@andrewharvey in this case, I think we should target |
Yep, that is indeed the goal. Let me know what else I can contribute here. Thanks for the feedback so far. |
It is, in that the spec is converted automatically into documentation. There are a couple ways we can go about this:
I suggest going with the first options to keep the docs consistent, and we consider a separate PR for the third option. |
@asheemmamoowala thanks for the recommendation! I think the ambiguity in the docs currently extends to two property pairs:
In both cases, the docs tell you one can't be used with the other, but if both are present, GL will make a choice. I agree this choice should be documented. In these cases, I think a good way forward is that the overriding property should have fewer requirements. The overriding property can exist in the presence of the secondary property. The secondary property is literally disabled in the presence of the overriding property.
I think we should keep this. Let me know if this makes sense to you - if so I will adjust the PR. Thanks again for your help and consideration here! |
Sounds good to me! |
👍 Those changes are reflected in the last commit. |
Hi, I realize I’m jumping in late here and I’m not sure of the visual effect that Derek's last commits will have. @dereklieu could you add another screenshot? I also don’t have a great understanding of how the text of our docs are generated. Is all of the text customizable? I’m wondering if it’s an option to make the overriding explicit for the docs on |
Hey @chloekraw I've attached some screenshots below that show the documentation wording that this would generate. I agree that the override language clarifies the behavior. However, I believe the An alternative is to include the override language in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dereklieu, looks good to me!
This PR partially addresses #8410.
text-field
requirement totext-radial-offset
andtext-variable-anchor
.!: text-variable-anchor
requirement totext-offset
.requires
field ontext-anchor
.cc @mapbox/studio