Skip to content

[AdminUi] RFC: Parametrized ThemeProvider to load further AdminUi implementation #329

@maxperei

Description

@maxperei

hi there,
i came across #296 recently and it made me curious about a new skin for sylius admin and how this could be loaded into the whole thing..

context

as a sylius developer, i wanted to switch between admin themes with a single configuration change so i was wondering about a new parameter in bundle configuration which will be responsible of choosing the resource we want to load custom ui :

# config/packages/sylius_admin_ui.yaml
sylius_admin_ui:
    theme: bootstrap  # or daisyui, shadcn, custom, etc.

as a sylius agency, this also could be useful to deploy multi-tenant projects with different branding requirements without duplicating codebase :

# .env.staging
SYLIUS_ADMIN_THEME=bootstrap

# .env.prod
SYLIUS_ADMIN_THEME=daisyui

# .env.client_acme
SYLIUS_ADMIN_THEME=acme

# config/packages/sylius_admin_ui.yaml
sylius_admin_ui:
    theme: '%env(SYLIUS_ADMIN_THEME)%'

status quo

users can already manage their imports with symfony flex recipes but this does not provide a centralized control for multi-environment setups

proof of concept

i tried to implement a working prototype that demonstrates :

  • theme registration via attributes
  • dynamic configuration loading via prepend()
  • comprehensive unit tests with fixtures
  • backward compatibility (existing manual imports still work)

next steps

if it is relevant enough i can:

  1. polish the pr with docs and changelog
  2. add a migration guide for existing projects
  3. create issues for follow-up features (theme:list command, inheritance, theme-specific configuration etc.)

looking forward to your feedback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions