这是indexloc提供的服务,不要输入任何密码
Skip to content

🖍 [Story performance] Added CSS rules for units, and exaple stories #36007

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

Closed
wants to merge 5 commits into from

Conversation

mszylkowski
Copy link
Contributor

@mszylkowski mszylkowski commented Sep 8, 2021

Closes #36045

In order to make the CSS provide the right values for the units, we need to encode them directly in the CSS rather than applying them from JS.

This PR sets the units to the correct size for mobile UI (fullscreen). When the story loads, the correct units will be set regardless of the UI type. We will need to set the correct units for desktop one panel UI in a future PR.

Steps (this PR is step a):
image

@amp-owners-bot
Copy link

amp-owners-bot bot commented Sep 8, 2021

Hey @gmajoulet, @newmuis! These files were changed:

extensions/amp-story/1.0/amp-story-page.js
extensions/amp-story/1.0/amp-story.css

@mszylkowski mszylkowski self-assigned this Sep 8, 2021
--story-page-vh: 1vh;
--story-page-vmin: min(var(--story-page-vw), var(--story-page-vh));
--story-page-vmax: max(var(--story-page-vw), var(--story-page-vh));
--i-amphtml-story-page-50vw: calc(var(--story-page-vw) * 50);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The round() was really needed, but I think it was for the 3 panels desktop so hopefully we can get rid of this variable entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, it gets removed entirely on #35932 so I'll also remove it from here, wait for that PR to merge, and then sync this branch and ensure everything is ok

@mszylkowski mszylkowski changed the title 🖍 [Story performance] Added CSS rules for units 🖍 [Story performance] Added CSS rules for units, and exaple stories Sep 10, 2021
@gmajoulet
Copy link
Contributor

Closing in favor of #36033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story performance] Calculate page sizes (vw/vh/font-size) on CSS for mobile
2 participants