Simulate amp-fit-text in regular block editor #3434
Labels
Enhancement
New feature or improvement of an existing one
Integration: Gutenberg
P2
Low priority
WS:Core
Work stream for Plugin core
Feature description
This has previously been explored in #1342.
For the AMP Stories editor we copied the logic of the
amp-fit-text
component so it can be used in the editor:amp-wp/assets/src/stories-editor/helpers/calculateFontSize.js
Lines 1 to 45 in 910eb10
This helper function can also be used in the regular block editor, where text blocks already have a toggle to turn on
amp-fit-text
, but users have to view the frontend to see it in action.Currently, the following blocks are considered text blocks and thus have this feature:
amp-wp/assets/src/block-editor/constants.js
Lines 1 to 7 in 910eb10
Worth noting that
core/subhead
doesn't actually exist, as it has been deprecated a long time ago.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
amp-fit-text
is being turned on for a text block, the displayed text should match the frontend presentation (WYSIWYG), i.e. the font size should matchImplementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: