-
Notifications
You must be signed in to change notification settings - Fork 4.1k
đź–Ť [Story performance] Set css units on desktop for supports-landscape and regular one-panel #36033
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
Merged
Merged
đź–Ť [Story performance] Set css units on desktop for supports-landscape and regular one-panel #36033
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
51e1ed9
Added CSS rules for units
mszylkowski 00e2b1c
Removed 50vw
mszylkowski 17f6cf7
Merge branch 'main' of github.com:ampproject/amphtml into css_units_m…
mszylkowski 9942c91
Added font and example files
mszylkowski fbb78e3
Add support for desktop panels
mszylkowski 888a821
Fix supports-landscape
mszylkowski 2347dfc
Fixed units CSS, removed JS
mszylkowski 9f5db1f
Removed unused dep
mszylkowski 08e1628
Merge branch 'main' of github.com:ampproject/amphtml into css_units_d…
mszylkowski 85e6d38
Remove unused JS style element
mszylkowski e85f1c1
Merge branch 'main' of github.com:ampproject/amphtml into css_units_d…
mszylkowski 0ac9066
Fix vertical rendering
mszylkowski 95432f8
Fixed list.push to list.add
mszylkowski ed1b19b
Fixed one-panel rems
mszylkowski c71bcd6
Merge branch 'main' of github.com:ampproject/amphtml into css_units_d…
mszylkowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <!-- Imports the story prestyle CSS so it can be laid out before the JS loads --> | ||
| <!doctype html> | ||
| <html ⚡ lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <link rel="canonical" href="lcp.html"> | ||
| <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
| <title>Boilerplate test</title> | ||
| <!-- <script async src="https://cdn.ampproject.org/v0.js"></script> | ||
| <script async custom-element="amp-story" src ="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script> --> | ||
| <!-- Fonts --> | ||
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
| <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap" rel="stylesheet"> | ||
| <link rel="stylesheet" href="https://cdn.ampproject.org/v0/amp-story-1.0.css"> | ||
|
|
||
| <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
|
|
||
| <style amp-custom> | ||
| amp-story-page { | ||
| font-family: 'Poppins', sans-serif; | ||
| color: black; | ||
| background-color: white; | ||
| } | ||
| h1 { | ||
| color: black; | ||
| font-size: 2em; | ||
| } | ||
| h1.preset { | ||
| font-size: 0.5em; | ||
| } | ||
| [preset="2021-foreground"] { | ||
| align-content: end; | ||
| padding: .5em; | ||
| } | ||
| p { | ||
| font-size: 1em; | ||
| } | ||
| [preset="2021-foreground"] p { | ||
| font-size: 0.25em; | ||
| } | ||
| html { | ||
| background: red; | ||
| } | ||
| body { | ||
| background: blue; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <amp-story standalone id="cats" | ||
| title="LCP test" publisher="The AMP team" | ||
| publisher-logo-src="./img/amplogo.png" | ||
| poster-portrait-src="./img/overview.jpg"> | ||
|
|
||
| <amp-story-page id="cover"> | ||
| <amp-story-grid-layer template="fill"> | ||
| <amp-img | ||
| id="img1" | ||
| width="400" | ||
| height="750" | ||
| src="https://images.unsplash.com/photo-1558591710-4b4a1ae0f04d?fit=crop&w=720&h=1280&q=30&fm=webp" | ||
| layout="fill"> | ||
| </amp-img> | ||
| </amp-story-grid-layer> | ||
| <amp-story-grid-layer template="vertical"> | ||
| <h1 class="hello-world">Story Prestyle + JS</h1> | ||
| <p>This is how a story looks with the prestyle+JS<br></p> | ||
| <p style="color: dimgray">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | ||
| </amp-story-grid-layer> | ||
| <amp-story-grid-layer template="vertical" preset="2021-foreground"> | ||
| <p style="color: dimgray">This text is positioned with an aspect-ratio layer</p> | ||
| </amp-story-grid-layer> | ||
| </amp-story-page> | ||
| </amp-story> | ||
| </body> | ||
| </html> |
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.