ampproject / ampproject/amphtml

Rewriting of viewport units does not work for inline styles

Open
#33,550 1 comment 0 reactions 0 assignees View on GitHub
P2: Soon Stale Type: Bug WG: stories
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

For stories, we rewrite viewport units (i.e. `vw`, `vh`, `vmin`, `vmax`) to refer to the size of the `amp-story-page`, rather than the user's actual viewport, since the page can sometimes be smaller than the viewport.

However, we only apply this transformation to styles specified in the `` tag. Since the initial implementation of this feature, AMP has expanded the flexibility to allow for inline styles; we need to also this transformation to inline styles as well.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing viewport-unit transformation for AMP stories and then trace how inline styles are processed. Add coverage for inline styles using vw, vh, vmin, and vmax; done means those units are rewritten for both inline styles and styles in the amp-custom tag.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.