-
Notifications
You must be signed in to change notification settings - Fork 194
Broken gradients when using the AMP plugin #4529
Copy link
Copy link
Closed
Labels
AMP OutputIssues related to AMP output and validationIssues related to AMP output and validationGroup: IntegrationIntegration with other platforms and pluginsIntegration with other platforms and pluginsGroup: WordPressChanges related to WordPress or Gutenberg integrationChanges related to WordPress or Gutenberg integrationType: BugSomething isn't workingSomething isn't working
Metadata
Metadata
Assignees
Labels
AMP OutputIssues related to AMP output and validationIssues related to AMP output and validationGroup: IntegrationIntegration with other platforms and pluginsIntegration with other platforms and pluginsGroup: WordPressChanges related to WordPress or Gutenberg integrationChanges related to WordPress or Gutenberg integrationType: BugSomething isn't workingSomething isn't working
Bug Description
After some very helpful feedback from Brodie Clark I've found that the AMP plugin is causing issues with gradients.
Here's what I found out when testing with a linear gradient:
The Web Stories plugin adds a
<div class="page-fullbleed-area">element which is a child of<amp-story-grid-layer>. The gradient is added as inline style to that element.It will look like this like this:
The AMP plugin extracts that inline style, gives the
diva new class(e.g.amp-wp-c307781) and adds CSS like:root:not(#_):not(#_):not(#_):not(#_):not(#_) .amp-wp-c307781{...}to the<style amp-custom=>style. So far so good.The problem:
The CSS looks as follows (formatted for readability):
Notice how
0turnbecame0 turn.This makes the
background-imagedeclaration now invalid CSS.Note:
This seems to apply only to linear gradients.
Radial gradients work fine, as the CSS looks like
background-image:radial-gradient(#fcfcfc 0.43%, #fd174e 100%)and the AMP plugin does not break it.Expected Behaviour
Gradients should work just fine when the AMP plugin is active.
Steps to Reproduce
Screenshots
Expectation:

vs. reality:
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria
Implementation Brief