Skip to content

Commit 9dbbf11

Browse files
committed
Add support for TailwindCSS 4 and Flowbite 4
1 parent 4b83e83 commit 9dbbf11

25 files changed

+226
-162
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Tests](https://img.shields.io/github/actions/workflow/status/tales-from-a-dev/flowbite-bundle/ci.yml?label=tests&style=for-the-badge)](https://github.com/tales-from-a-dev/flowbite-bundle/actions/workflows/ci.yml)
22
![PHP Version](https://img.shields.io/badge/php->=8.1-4f5b93.svg?style=for-the-badge)
33
![Symfony Version](https://img.shields.io/badge/symfony->=6.4-000.svg?style=for-the-badge)
4-
[![Flowbite Version](https://img.shields.io/badge/flowbite->=1.6-1c64f2.svg?style=for-the-badge)](https://flowbite.com)
4+
[![Flowbite Version](https://img.shields.io/badge/flowbite->=4.0-1c64f2.svg?style=for-the-badge)](https://flowbite.com)
55
[![Packagist Version](https://img.shields.io/packagist/v/tales-from-a-dev/flowbite-bundle?style=for-the-badge)](https://packagist.org/packages/tales-from-a-dev/flowbite-bundle)
66
[![License](https://img.shields.io/github/license/talesfromadev/flowbite-bundle?style=for-the-badge)](https://github.com/tales-from-a-dev/flowbite-bundle/blob/main/LICENSE)
77

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"php": ">=8.1",
2222
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0",
2323
"symfony/twig-bridge": "^6.4 || ^7.0 || ^8.0",
24-
"tales-from-a-dev/twig-tailwind-extra": "^0.5"
24+
"tales-from-a-dev/twig-tailwind-extra": "^1.0"
2525
},
2626
"require-dev": {
2727
"friendsofphp/php-cs-fixer": "^3.15",

docs/custom_form_types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom Form Types
22

3-
This bundle provide the following custom form types:
3+
This bundle provides the following custom form types:
44

55
## SwitchType
66

docs/index.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Prerequisites
44

5-
This bundle requires **PHP 8.1+**, **Symfony 6.4+** and **Flowbite 1.6+**.
5+
This bundle requires **PHP 8.1+**, **Symfony 6.4+** and **Flowbite 4.0+**.
66

77
## Installation
88

@@ -34,16 +34,26 @@ return [
3434

3535
### Configuring Tailwind CSS
3636

37-
Update your Tailwind configuration file to include the `templates` folder of the bundle:
37+
Update your Tailwind configuration to include the `templates` folder of the bundle:
38+
39+
```css
40+
/* assets/styles/app.css */
41+
42+
@source "../../vendor/tales-from-a-dev/flowbite-bundle/templates/**/*.html.twig";
43+
```
44+
45+
#### Legacy Tailwind CSS configuration
46+
47+
If you are using the legacy Tailwind CSS configuration, add the following line to your `tailwind.config.js` file:
3848

3949
```js
4050
// tailwind.config.js
4151

4252
module.exports = {
43-
content: [
44-
//...
45-
"./vendor/tales-from-a-dev/flowbite-bundle/templates/**/*.html.twig"
46-
],
53+
content: [
54+
//...
55+
"./vendor/tales-from-a-dev/flowbite-bundle/templates/**/*.html.twig"
56+
],
4757
}
4858
```
4959

@@ -60,9 +70,17 @@ twig:
6070
- '@TalesFromADevFlowbite/form/default.html.twig'
6171
```
6272
63-
## Run the watcher
73+
### Compiling assets
74+
75+
Finally, run one of the following commands to build your front-end assets:
76+
77+
#### With [Tailwind bundle](https://symfony.com/bundles/TailwindBundle/current/index.html)
78+
79+
```bash
80+
php bin/console tailwind:build
81+
```
6482

65-
Finally, run the following command to compile the front-end assets via Webpack:
83+
#### With Webpack Encore
6684

6785
```bash
6886
# With npm

docs/theme_customization.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Overriding CSS classes
44

5-
All used CSS classes are contained in [Twig blocks](https://github.com/talesfromadev/flowbite-bundle/blob/main/templates/form/default.twig#L244)
6-
which allows to customize the theme very easily.
5+
All CSS classes are contained in [Twig blocks](https://github.com/talesfromadev/flowbite-bundle/blob/main/templates/form/default.twig#L244)
6+
which allows customizing the theme very easily.
77

88
Create a new theme in your `templates` directory and make it use the bundle `default` theme:
99

@@ -13,7 +13,7 @@ Create a new theme in your `templates` directory and make it use the bundle `def
1313
{% use '@TalesFromADevFlowbite/form/default.html.twig' %}
1414
```
1515

16-
Now, just override the desire block with any Tailwind CSS class you want:
16+
Now, override the desired block with any Tailwind CSS class you want:
1717

1818
```php
1919
# templates/form/layout.html.twig
@@ -25,7 +25,7 @@ Now, just override the desire block with any Tailwind CSS class you want:
2525
{%- endblock class_submit %}
2626
```
2727

28-
Finally, don't forget to update your `twig` configuration to use your newly created template:
28+
Finally, update your `twig` configuration to use your newly created template:
2929

3030
```yaml
3131
# config/packages/twig.yaml
@@ -36,9 +36,9 @@ twig:
3636
- 'form/layout.html.twig'
3737
```
3838
39-
## Class block list
39+
## Class blocks list
4040
41-
Here is a list of all available class block:
41+
Here is a list of all available class blocks:
4242
4343
* Label
4444
* class_label
@@ -60,12 +60,13 @@ Here is a list of all available class block:
6060
* class_button
6161
* class_submit
6262
* Various
63-
* class_time_separator
63+
* class_input_group
6464
* class_addon
6565
* class_widget_addon_prepend
6666
* class_widget_addon_append
6767
* class_addon_prepend
6868
* class_addon_append
69+
* class_time_separator
6970
* class_help_text
7071
* Error
7172
* class_label_error

0 commit comments

Comments
 (0)