Problem/Motivation
The Canvas backend editor (/canvas/editor/…) uses the site default (front-end) theme. This module enables async remaining CSS whenever the active theme is in enabled_themes / the theme’s info.yml. The only extra skip is media.oembed_iframe. There is no equivalent of SDC Critical CSS’s editorial skip (_admin_route, _hide_admin_toolbar, iframe).
Result: Canvas editor UI CSS is loaded as preload-as-style. Styles break on the edit screen. The same sites are fine with SDC Critical CSS alone on public Canvas pages.
Mercury Editor preview iframes can hit the same path (front-end theme + async CSS). Companion issue on SDC Critical CSS covers inlining/aggregate stripping there.
Steps to reproduce
- Enable Non-critical CSS for the default theme (and SDC Critical CSS as documented).
- Open a Canvas editor URL, e.g.
/canvas/editor/canvas_page/{id}. - Editor styles are broken. Public pages of the same site are OK.
Observed on Drupal CMS Canvas site templates (e.g. Convene).
Proposed resolution
Add a skip in shouldOptimizeCssDelivery() (or equivalent) before async rendering. Mirror SDC Critical CSS:
_admin_route_hide_admin_toolbarSec-Fetch-Dest: iframe_mercury_editor_route- route name matching
mercury_editor.*/*.mercury_editor_preview/canvas.* - path prefix
/mercury-editoror/canvas/
No hard dependency on Canvas or Mercury. Optional alter hook later if other editors need an in. Keep the oEmbed skip.
Remaining tasks
- Implement the skip; do not async CSS on those requests.
- Tests for Canvas editor path, admin route, iframe, oEmbed still skipped.
- README: editorial overlays are skipped; public pages unchanged.
User interface changes
None.
API changes
None for existing settings. New skip is request-time only.
Data model changes
None.
Comments
Comment #3
drale01 commentedCommitted to 1.0.x: https://git.drupalcode.org/project/non_critical_css/-/commit/fd2a63f
Async remaining CSS is skipped on Canvas editor, Mercury Editor, admin/iframe overlays. Tested on Convene Canvas editor. Public pages still use async delivery.
Related: #3631045