Skip to content

Per-block color scheme override #6

Description

@ajaydsouza

Summary

Allow choosing a different color scheme for an individual code block, overriding the global setting.

Details

  • New colorScheme attribute with a SelectControl in InspectorControls (default: inherit global).
  • Styles_Handler::enqueue_assets() must enqueue each theme CSS used on the page and scope it — either by wrapping per-theme CSS under a .wzcbh-theme-{slug} class at build time (extend build-prism.js) or via inline scoped styles.
  • Editor canvas preview should reflect the per-block theme where feasible.
  • Applies identically in client and server modes since both use the same Prism theme CSS.

Why

Useful for showcasing themes, differentiating terminal output vs code, or matching different post designs. Enlighter offers per-block theming and it's a popular capability.

Speed to implement: Fast · Usefulness: Medium · Rank: 6

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions