Skip to content

added story ad badge fix for safari#35429

Merged
powerivq merged 7 commits intoampproject:mainfrom
jshamble:story-ad-badge-blur-fix
Jul 30, 2021
Merged

added story ad badge fix for safari#35429
powerivq merged 7 commits intoampproject:mainfrom
jshamble:story-ad-badge-blur-fix

Conversation

@jshamble
Copy link
Copy Markdown
Contributor

Fixes the story ad badge for iOS devices by using the static html template in order to load the svg via javascript instead of css. Before this fix, it was pixelated / blurry (on iOS device such as the iphone X), now it is sharp and clear. Removed some unnecessary css rules.

🐛 Bug fix
🖍 CSS / Styling

@amp-owners-bot amp-owners-bot bot requested a review from gmajoulet July 28, 2021 06:23
@amp-owners-bot
Copy link
Copy Markdown

Hey @erwinmombay, @jridgewell! These files were changed:

build-system/eslint-rules/html-template.js

@jshamble jshamble requested a review from powerivq July 28, 2021 21:34
@calebcordry calebcordry self-requested a review July 29, 2021 21:47
@jshamble jshamble requested a review from jridgewell July 29, 2021 22:13
@powerivq powerivq merged commit 08b5d9f into ampproject:main Jul 30, 2021
@calebcordry
Copy link
Copy Markdown
Member

I think we accidentally changed the UI a bit here.

OLD

image
image

NEW

image
image

DESIGN SPEC
image

Let's get a fix in ASAP. Also we should write a test to prevent similar issues in the future.

@newmuis
Copy link
Copy Markdown
Contributor

newmuis commented Jul 30, 2021

Super curious: why does loading the SVG via JS instead of CSS fix this?

@jridgewell
Copy link
Copy Markdown
Contributor

The CSS background is being rasterized once to a PNG (internally in the browser), and then being resized. Creating true SVG nodes allows the browser to scale the SVG infinitely, making the text appear much crisper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants