Extract CSS sanitizer into AMP Toolbox PHP #5602
Labels
CSS
Infrastructure
Changes impacting testing infrastructure or build tooling
P2
Low priority
WS:Core
Work stream for Plugin core
Feature description
This is part of #2315.
Now that we have the
amp-toolbox-php
repo which is the home of the PHP AMP Optimizer, a next step is to start porting the sanitizers from the AMP plugin over to be generic PHP to be distributed in that package. The CSS sanitizer is a key example of that. It should be extracted from the AMP plugin so that other PHP-based projects can make use of it.One thing that won't work well outside of WordPress is the stylesheet prioritization scheme. When there is too much CSS even after tree-shaking, we start excluding stylesheets that we determine are less important. The importance is partly informed by where the CSS comes from. For example, a theme's stylesheet should be considered more important than a plugin stylesheet. So I suppose it would be up to the Drupal integrator to provide their own heuristics for determining priority. As part of the extraction from the AMP plugin, there needs to be an interface for providing those heuristics.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: