-
Notifications
You must be signed in to change notification settings - Fork 178
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
Save/output/preview templates with units and wrappers. #137
Conversation
bb53ee7
to
48dc840
Compare
615fc89
to
81f04a8
Compare
ab9c55c
to
8970e95
Compare
81f04a8
to
9b5fd08
Compare
@miina, @swissspidy, this is the first draft that I wanted to see if there are any major concerns that you see. I'm still testing it and cleaning up. But here are the major themes:
|
Makes sense to me, this was considered initially as well but at that point Output and Preview seemed to be more similar, this has changed with the refactoring work. Q: Didn't see any preview related code in the PR even though it's mentioned in the comment -- is this still an idea/local only or forgot to push? Same for the 9:16 safe area -- it's currently in the Generally, the points make sense to me. Looking forward to hearing feedback about the responsive font size from the Stories team. |
Yep! Forgot to push. Sorry about that.
I think currently this PR has a good take on But to clarify, this is how the conversion works now:
|
@miina @swissspidy this is ready for review |
height: `calc(100 * ${ PAGE_HEIGHT / PAGE_WIDTH } * var(--story-page-vw))`, // 16/9 * 100vw | ||
maxHeight: `calc(100 * var(--story-page-vh))`, // 100vh | ||
maxWidth: `calc(100 * ${ PAGE_WIDTH / PAGE_HEIGHT } * var(--story-page-vh))`, // 9/16 * 100vh | ||
// todo@: this expression uses CSS `min()`, which is still very sparsely |
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.
Should this (the min()
) be addressed already now? It looks like it's not supported in Firefox at all which would likely mean the font not being displayed. Thoughts?
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.
I think this will just have to be wrong for now until we get some assistance from the Runtime team to make it cross-browser.
These are "data pixels". They are based on the 1080:1920. They do not depend on the size of the page card. I.e. if the window is resized smaller, and the page area gets smaller, the measurements in the side panel do not change. IMHO, 1080:1920 it's a pretty big base and we might change it later. But on the other side, I think, the idea is that people don't pay a lot of attention to these numbers outside just understanding their relative nature. |
According to Figma, the user can change width/height in numbers and also the font size. Should then the numbers not be displayed to the user instead? E.g. the user can increase/decrease the font/width/height without seeing the numbers behind? I understand these are "data pixels", however, thinking of a user who might find a huge font size number unexpected. Thoughts? |
Yeah, I think it's definitely possible. And I think UX is still looking at this. But not sure if they have good options. IMHO we should go back to the smaller "data space", e.g. 412:732. But UX will be probably experimenting with it for a bit. Our most commonly intended page area size is 412:732 and I'm not sure going so far above it is very useful. However, development-wise, 1080:1920 at this point is actually very helpful. I fixed a number of issues where I missed relative conversion because it was visually harder to notice at 412:732 and became very obvious at 1080:1920. |
Ah, alright, then we can just wait for the UX on this and adjust later if needed. 👍 |
Yep. Thus this is quite independent from this PR. And the new migration tools can easily help us transition to the next system w/o disruption like this: https://github.com/google/web-stories-wp/blob/master/assets/src/edit-story/migration/migrations/v0002_dataPixelTo1080.js |
Alright, sounds good. I created some merge conflicts now. |
b7dba99
to
ec57067
Compare
@miina the pr is rebased with your latest changes. |
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.
LGTM
Fixes #198.
Follow up on #136 to apply units and wrappers to save/output/wrapper templates.
Forked from ampproject/amp-wp#4173