[Toolkit][Flowbite] Add kit Flowbite 4.0 base#28
Conversation
DcgRG
commented
Mar 8, 2026
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | yes |
| Issues | |
| License | MIT |
|
|
||
| input_css: | ||
| - assets/styles/toolkit-shadcn.css | ||
| - assets/styles/toolkit-flowbite-4.css |
There was a problem hiding this comment.
This file is not built when running tailwind:build, only the first is (I don't know why this choice?)
But it now means that we should replace our calls to tailwind:build to:
bin/console tailwind:build assets/styles/toolkit-shadcn.css
bin/console tailwind:build assets/styles/toolkit-flowbite-4.cssMaybe we can create a Composer script to make things easier?
1ed4f93 to
deedb34
Compare
28def89 to
76d7153
Compare
76d7153 to
2019ac8
Compare
|
Thank you! |
There was a problem hiding this comment.
Pull request overview
Adds the Flowbite 4.0 Toolkit kit to the UX Toolkit site/docs so Flowbite components can be previewed and documented alongside existing kits.
Changes:
- Introduces a new
flowbite-4kit ID with a main color, icon, and Twig helper to render kit color in the UI. - Adds Flowbite 4 component documentation templates (markdown Twig) and a dedicated Flowbite 4 asset entrypoint (JS + Tailwind/CSS).
- Updates importmap, Tailwind inputs, and Composer scripts/lockfile to include Flowbite 4 dependencies and build steps.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/ux_packages/toolkit.html.twig | Uses a per-kit CSS variable color for kit tiles. |
| templates/toolkit/docs/flowbite-4/alert.md.twig | Adds Flowbite 4 Alert docs (demo/usage/examples). |
| templates/toolkit/docs/flowbite-4/badge.md.twig | Adds Flowbite 4 Badge docs. |
| templates/toolkit/docs/flowbite-4/button-group.md.twig | Adds Flowbite 4 ButtonGroup docs (incl. accessibility block). |
| templates/toolkit/docs/flowbite-4/button.md.twig | Adds Flowbite 4 Button docs. |
| templates/toolkit/docs/flowbite-4/card.md.twig | Adds Flowbite 4 Card docs. |
| templates/toolkit/docs/flowbite-4/checkbox.md.twig | Adds Flowbite 4 Checkbox docs. |
| templates/toolkit/docs/flowbite-4/indicator.md.twig | Adds Flowbite 4 Indicator docs. |
| templates/toolkit/docs/flowbite-4/input.md.twig | Adds Flowbite 4 Input docs. |
| templates/toolkit/docs/flowbite-4/kbd.md.twig | Adds Flowbite 4 KBD docs. |
| templates/toolkit/docs/flowbite-4/label.md.twig | Adds Flowbite 4 Label docs. |
| templates/toolkit/docs/flowbite-4/modal.md.twig | Adds Flowbite 4 Modal docs. |
| templates/toolkit/docs/flowbite-4/pagination.md.twig | Adds Flowbite 4 Pagination docs. |
| templates/toolkit/docs/flowbite-4/radio.md.twig | Adds Flowbite 4 Radio docs. |
| templates/toolkit/docs/flowbite-4/select.md.twig | Adds Flowbite 4 Select docs. |
| templates/toolkit/docs/flowbite-4/skeleton.md.twig | Adds Flowbite 4 Skeleton docs. |
| templates/toolkit/docs/flowbite-4/spinner.md.twig | Adds Flowbite 4 Spinner docs. |
| templates/toolkit/docs/flowbite-4/table.md.twig | Adds Flowbite 4 Table docs. |
| templates/toolkit/docs/flowbite-4/tabs.md.twig | Adds Flowbite 4 Tabs docs. |
| templates/toolkit/docs/flowbite-4/textarea.md.twig | Adds Flowbite 4 Textarea docs. |
| templates/toolkit/docs/flowbite-4/toggle.md.twig | Adds Flowbite 4 Toggle docs. |
| src/Twig/Extension/ToolkitRuntime.php | Adds runtime method to expose kit main color to Twig. |
| src/Twig/Extension/ToolkitExtension.php | Registers new toolkit_main_color Twig function. |
| src/Enum/ToolkitKitId.php | Adds Flowbite4 enum case + main color mapping. |
| assets/toolkit-flowbite-4.js | New importmap entrypoint to load Flowbite + Stimulus controllers. |
| assets/styles/toolkit-flowbite-4.css | New Tailwind/CSS entry stylesheet for Flowbite 4 kit. |
| assets/icons/toolkit/flowbite-4.svg | Adds Toolkit icon for the Flowbite 4 kit. |
| importmap.php | Adds Flowbite 4 entrypoint, controllers, and Flowbite dependencies. |
| config/packages/symfonycasts_tailwind.yaml | Adds Flowbite 4 CSS to Tailwind build inputs. |
| composer.json | Adjusts post-install/update scripts and adds a multi-target Tailwind build script. |
| README.md | Documents building Toolkit assets via Composer script. |
| composer.lock | Updates symfony/ux-toolkit reference (and related metadata). |
| config/reference.php | Updates config reference type docs (likely from dependency update). |
| .twig-cs-fixer.dist.php | Adjusts Twig CS Fixer directory/file naming rules for toolkit docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| yield new TwigFunction('toolkit_code_example', [ToolkitRuntime::class, 'codeExample'], ['is_safe' => ['html']]); | ||
| yield new TwigFunction('toolkit_code_demo', [ToolkitRuntime::class, 'codeDemo'], ['is_safe' => ['html']]); | ||
| yield new TwigFunction('toolkit_code_usage', [ToolkitRuntime::class, 'codeUsage'], ['is_safe' => ['html']]); | ||
| yield new TwigFunction('toolkit_main_color', [ToolkitRuntime::class, 'kitColor'], ['is_safe' => ['html']]); |
There was a problem hiding this comment.
toolkit_main_color returns a plain string used inside an HTML attribute; marking the Twig function as is_safe: ['html'] disables escaping unnecessarily and makes it easier to introduce an injection if the implementation ever changes. Consider removing the is_safe flag (or using an attribute-safe strategy) so Twig keeps escaping by default.
| yield new TwigFunction('toolkit_main_color', [ToolkitRuntime::class, 'kitColor'], ['is_safe' => ['html']]); | |
| yield new TwigFunction('toolkit_main_color', [ToolkitRuntime::class, 'kitColor']); |
| ->addRule(new FileNameRule(case: FileNameRule::PASCAL_CASE, baseDirectory: 'templates/components')) | ||
| ->addRule(new DirectoryNameRule(case: DirectoryNameRule::PASCAL_CASE, baseDirectory: 'demos/live_memory/components')) | ||
| ->addRule(new FileNameRule(case: FileNameRule::PASCAL_CASE, baseDirectory: 'demos/live_memory/components')) | ||
| ->addRule(new DirectoryNameRule(case: FileNameRule::KEBAB_CASE, baseDirectory: 'templates/toolkit/docs/')) |
There was a problem hiding this comment.
DirectoryNameRule is being configured with case: FileNameRule::KEBAB_CASE. This looks like the wrong enum/constant source (DirectoryNameRule already uses its own constants, e.g. DirectoryNameRule::PASCAL_CASE above). Switch to the matching DirectoryNameRule::KEBAB_CASE constant to avoid misconfiguration or runtime errors if the constants diverge.
| ->addRule(new DirectoryNameRule(case: FileNameRule::KEBAB_CASE, baseDirectory: 'templates/toolkit/docs/')) | |
| ->addRule(new DirectoryNameRule(case: DirectoryNameRule::KEBAB_CASE, baseDirectory: 'templates/toolkit/docs/')) |
| 'flowbite-datepicker' => [ | ||
| 'version' => '2.0.0', | ||
| ], |
There was a problem hiding this comment.
flowbite-datepicker is added to the importmap but doesn't appear to be referenced anywhere else in the repository. If it's not required for the current Flowbite 4 base kit, consider removing it until a datepicker component is actually introduced to avoid extra downloads/maintenance.
| 'flowbite-datepicker' => [ | |
| 'version' => '2.0.0', | |
| ], |
| "tailwind:build": [ | ||
| "@php bin/console tailwind:build assets/styles/app-tailwind.css", | ||
| "@php bin/console tailwind:build assets/styles/toolkit-shadcn.css", | ||
| "@php bin/console tailwind:build assets/styles/toolkit-flowbite-4.css" |
There was a problem hiding this comment.
The new tailwind:build script uses @php bin/console ... while the rest of the Flex auto-scripts use symfony-cmd. Using symfony-cmd here as well keeps behavior consistent (env vars, Symfony CLI integration) and avoids differences between local/CI execution.
|
Oops, I totally forgot that I asked GitHub Copilot for review, and merged before its review 😅 |
|
Done in 20a1afc |