Version 2.0.2 broke my navigation menus because of CSS sanitizer #5401
Labels
Bug
Something isn't working
Changelogged
Whether the issue/PR has been added to release notes.
CSS
P0
High priority
WS:Core
Work stream for Plugin core
Milestone
Bug Description
I'm a theme developer and have added AMP support to several of my themes. I'm using
tap:AMP.setState()
to set atoggled-on
class for multiple mobile dropdown menus and dropdown search fields.Example CSS:
My issue is that the
.main-navigation.toggled-on
class is missing in the AMP CSS since version 2.0.2 and seems to be removed by the Sanitizer. I guess that happens because thetoggled-on
class is not actually used by default in the HTML markup, only interactively added later.Because of the missing class, mobile menus are broken with AMP active.
Expected Behaviour
I would like to manually control the CSS sanitizer so my
toggled-on
class is included in the AMP CSS. I did not find any filter or action hook, but maybe I missed it.Steps to reproduce
Example of the implementation used:
https://github.com/ThemeZee/harrison/blob/master/template-parts/header/site-navigation.php
https://github.com/ThemeZee/harrison/blob/master/inc/addons.php#L93
Theme Demo with AMP active: https://preview.themezee.com/harrison/
When inspecting, you can see the
toggled-on
class is added, but has no effect because it is missing in the CSS.Additional context
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: