Closed
Description
Description
Currently, all form themes are located into symfony/twig-bridge
. This has some major drawbacks:
- Download all themes when you only want to use one
- No autoconfiguration from Flex
- Impossible to create theme specific
FormType
- Bootstrap 5 inline radio/checkbox and switches need a class hack to work while with a SwitchType things are easier
- Testing is complicated
Example
I propose to extract all form themes except form_div_layout.html.twig
and form_table_layout.html.twig
into the symfony/ux
repository or a dedicated one (symfony/form-theme
, symfony/ui
?) and split each themes into individual packages
symfony/ux-theme-bootstrap
symfony/ux-theme-tailwind
symfony/ux-theme-foundation
- etc ...
Here is an exaustive list of benefits that this could bring:
- Require only the desire form theme (
composer req symfony/ux-theme-bootstrap
) - Recipes from Flex (autoconfiguring
twig.form_themes
orwebpack.config.js
, updatepackages.json
etc ...) - Custom FormType (SwitchType for Bootstrap)
- Simplify maintenance (split tests which are a mess, see [RFC] Simplify form theme testing for external packages #49775)
- New form themes from the community