ampproject / ampproject/amphtml

`<amp-fit-text>` ignores CSS that affects text layout

Open
#17,464 5 comments 0 reactions 1 assignee Claimed by @rbeckthomas View on GitHub
Component: amp-fit-text P3: When Possible Stale Type: Bug Type: DevX WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

Originally reported as: https://github.com/ampproject/amp-by-example/issues/1454

When you apply any CSS to `` that affects the size (e.g. padding, border), the sizing is done without taking any of those properties into consideration.

As a workaround, you can apply the styles to a parent container of ``, which will affect the the measuring element. This workaround does not work for `line-height`, since that is set on the measuring Element directly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.