Aspect ratio format for amp-story-grid-layer#27027
Merged
dvoytenko merged 9 commits intoampproject:masterfrom Mar 7, 2020
Merged
Aspect ratio format for amp-story-grid-layer#27027dvoytenko merged 9 commits intoampproject:masterfrom
dvoytenko merged 9 commits intoampproject:masterfrom
Conversation
Contributor
Author
|
/cc @pbakaus |
newmuis
reviewed
Feb 28, 2020
| margin: auto; | ||
| width: var(--i-amphtml-story-layer-width, 100%); | ||
| height: var(--i-amphtml-story-layer-height, 100%); | ||
| font-size: calc(var(--i-amphtml-story-layer-height, 100vh) / 10); |
Contributor
There was a problem hiding this comment.
So, am I reading this correctly that the default font-size is 1/10 the height of the root container?
Contributor
Author
There was a problem hiding this comment.
Yes. That's the suggestion. See the description of the PR for how I got here.
gmajoulet
reviewed
Mar 2, 2020
gmajoulet
approved these changes
Mar 5, 2020
|
Hey @ampproject/wg-caching, these files were changed: |
9ac5014 to
79ffbb6
Compare
extensions/amp-story/1.0/test/validator-amp-story-grid-layer-error.out
Outdated
Show resolved
Hide resolved
3642a1b to
3a67516
Compare
Contributor
Author
|
@gmajoulet @newmuis @honeybadgerdontcare I made the changes. PTAL. |
Contributor
honeybadgerdontcare
left a comment
There was a problem hiding this comment.
validation changes look good
twifkak
added a commit
to twifkak/amphtml
that referenced
this pull request
Mar 12, 2020
Merged
twifkak
added a commit
that referenced
this pull request
Mar 12, 2020
* cl/299411284 Allow links with `tel` scheme in email spec * cl/300054759 github commit msg missing or malformed * cl/300575599 Revision bump for #27098 * cl/300578001 Revision bump for #27132 * cl/300590811 Revision bump for #27027 * cl/300593269 Revision bump for #27170 * cl/300596115 Revision bump for #27134 * cl/300598356 Revision bump for #27076 * cl/300599497 Revision bump for #26912 Co-authored-by: honeybadgerdontcare <sedano@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #27049
Blocked by: #27145
Let's discuss and if this works I will add the tests, validator rules, and documentation.
The most critical aspect here is
font-size. Everything else could in theory be calculated via CSS, but font-size is the only outlier. Thefont-sizehas to be referenceable from the height, or in other wordsfont-size = X% of height. So the only real choice here isX. I started with100%, but then I actually tried10%and I liked that a lot better. It's quite natural to useemunits with that, as well as%values. Let me know what you think.Another nuance: I used two private CSS vars and moved the actual CSS assignments to the private
i-amphtml-story-grid-template-aspectclass. I did this so that it's easy to override any of these values in the user stylesheet.TODO: