Use UI Styles Source Plugins

Created on 5 May 2025, 13 days ago

Problem/Motivation

UI Styles Paragraphs module doesn't show color previews in forms. It always uses a basic dropdown without previews, even when preview settings are defined in the YAML file.

Steps to reproduce

1. Install UI Styles and UI Styles Paragraphs modules
2. Add background colors in a theme's YAML file with preview settings
3. Enable these styles for paragraphs
4. Edit a paragraph and see that there are no color previews in the form

Proposed resolution

Update the UIStyleOptions class to use the UI Styles source plugins. This will:
1. Add the source plugin manager to the class
2. Find the right plugin for each style
3. Use that plugin to create the form element with previews
4. Fall back to a basic dropdown if no plugin works

Remaining tasks

1. Test the patch on different sites
2. Check that all source plugins work correctly
3. Update documentation

User interface changes

Forms will now show visual previews for styles:
- Background colors will show color swatches
- Text alignments could show alignment icons
- Spacing options could show spacing indicators

This makes it easier for editors to pick the right option.

API changes

No API changes.

Data model changes

No data model changes.

✨ Feature request
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States vml-bsummers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024