Amp-wp: [AMP Stories] Add any missing features necessary for templates

Created on 21 Mar 2019  路  12Comments  路  Source: ampproject/amp-wp

AC: All the features needed for the templates exist.
AC: User can set border radius to Image and Text blocks via block style (accessible via block style button in the left top corner of the block, or in the right sidebar in the block settings.
AC: User can align the text in Text block.
AC: User can add a gradient to the Page block.

  • [x] Look through the templates and log the features that we need to add for templates.
  • [x] Implement any missing features.

Features needed:

  • [x] Add border radius setting to Text block and Image block [Done, see #2055].
  • [x] Add alignment options for the Text block.
  • [x] Add gradient setting for Page. [Done, see #2046]

Add opacity Range control to allowed (child) blocks which use background color. Moved to a separate issue: #2058

AMP Stories (obsolete)

All 12 comments

Based on the template designs the following features seem to be missing:

  • Adding opacity to block (this would also be useful with a Color Fill block -- a resizable block which can be just filled with color and then placed on top of an image or background image is 100% size with opacity setting);
  • Gradient (would also be useful with a Color Fill block).
  • Aligning text to center;
  • Rotation (is already logged in #2005.)

cc @swissspidy @westonruter

Color Fill block: My immediate thought was https://github.com/WordPress/gutenberg/issues/4900. The PR for that, https://github.com/WordPress/gutenberg/pull/13964, is still in the works, but according to the comments there it might be ready soon.

Aligning text to center

Should be as easy as setting supports: { align: true } and adding the necessary text-align CSS.

As I'm sure you're aware, also related to Section block is the Cover Image as a proto block: it allows you to add additional children to it. The Overlay has a color and opacity setting:

image

  • Adding opacity to block

What about adding opacity to a block as a whole, and not just the background color? I know this was done for layers in the previous incarnation of AMP Stories. Maybe that is just asking for trouble.

What about adding opacity to a block as a whole, and not just the background color? I know this was done for layers in the previous incarnation of AMP Stories. Maybe that is just asking for trouble.

Unless there is a reason why not to then seems like we could add it generally for other blocks, too, or at least to Image and Text Block.

Another style-related thing that occurs frequently in the templates is having rounded corners for images and Text blocks with background color. Maybe that'd also be something necessary?

It would indeed be useful if background colors _everywhere_ in Gutenberg had the ability to specify the opacity. It's not currently provided normal Color Settings:

image

The Overlay has the opacity as a separate slider for Background Opacity as shown above:

image

By it would be cool if all color pickers just had opacity as a standard parameter.

Another style-related thing that occurs frequently in the templates is having rounded corners for images and Text blocks with background color. Maybe that'd also be something necessary?

Oh yeah, a border radius setting for the text block and image block would be very nice!

Ticket description is now updated based on the discussion.

a border radius setting for the text block and image block would be very nice

Could this be a block style instead? Then one could choose between "Default" and "Rounded" without having to worry about the block radius always being consistent between blocks. Or is there a strong use case for a block radius range control?

"Default" and "Rounded" should be sufficient, we can adjust later if it should become necessary.

Will start working on adding the gradient/scrim setting to Page. cc @swissspidy

verified in QA

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KhalidAlmallahi picture KhalidAlmallahi  路  4Comments

swissspidy picture swissspidy  路  3Comments

alexhaller picture alexhaller  路  5Comments

westonruter picture westonruter  路  5Comments

schlessera picture schlessera  路  5Comments