From a4ffaca6a6a249afed4bd9ff974de8f876b0af32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melaine=20G=C3=A9rard?= Date: Wed, 19 Feb 2025 14:38:24 +0100 Subject: [PATCH] :sparkles: Passage Tailwind 4 --- assets/styles/app.css | 28 +++++++++++++++++-- config/packages/symfonycasts_tailwind.yaml | 2 +- tailwind.config.js | 15 ---------- templates/admin/user_edit.html.twig | 2 +- templates/admin/user_index.html.twig | 6 ++-- templates/files/create_directory.html.twig | 2 +- templates/files/file_edit.html.twig | 6 ++-- templates/files/index.html.twig | 6 ++-- templates/files/rename.html.twig | 2 +- templates/files/upload.html.twig | 2 +- templates/partials/navbar-admin.html.twig | 10 +++---- templates/partials/navbar.html.twig | 18 ++++++------ .../reset_password/check_email.html.twig | 2 +- templates/reset_password/request.html.twig | 2 +- templates/reset_password/reset.html.twig | 2 +- templates/security/login.html.twig | 4 +-- 16 files changed, 58 insertions(+), 51 deletions(-) delete mode 100755 tailwind.config.js diff --git a/assets/styles/app.css b/assets/styles/app.css index b5c61c9..46885ee 100755 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -1,3 +1,25 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; +@import 'tailwindcss'; + +@plugin 'flowbite/plugin'; + +@source '../../vendor/tales-from-a-dev/flowbite-bundle/templates/**/*.html.twig'; + +@custom-variant dark (@media (prefers-color-scheme: dark)); + +/* + The default border color has changed to `currentColor` in Tailwind CSS v4, + so we've added these compatibility styles to make sure everything still + looks the same as it did with Tailwind CSS v3. + + If we ever want to remove these styles, we need to add an explicit border + color utility to any element that depends on these defaults. +*/ +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentColor); + } +} diff --git a/config/packages/symfonycasts_tailwind.yaml b/config/packages/symfonycasts_tailwind.yaml index ef4e3b9..46640a0 100644 --- a/config/packages/symfonycasts_tailwind.yaml +++ b/config/packages/symfonycasts_tailwind.yaml @@ -1,2 +1,2 @@ symfonycasts_tailwind: - binary_version: 'v3.4.17' \ No newline at end of file + binary_version: 'v4.0.7' \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100755 index 64c0637..0000000 --- a/tailwind.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - "./vendor/tales-from-a-dev/flowbite-bundle/templates/**/*.html.twig", - "./assets/**/*.js", - "./templates/**/*.html.twig", - ], - theme: { - extend: {}, - }, - plugins: [ - require('flowbite/plugin') - ], - darkMode: 'media', -} diff --git a/templates/admin/user_edit.html.twig b/templates/admin/user_edit.html.twig index 138f247..3936c71 100755 --- a/templates/admin/user_edit.html.twig +++ b/templates/admin/user_edit.html.twig @@ -2,7 +2,7 @@ {% block body %}
-
+

{% if not isNew %} Edition de l'utilisateur {{ user.email }} diff --git a/templates/admin/user_index.html.twig b/templates/admin/user_index.html.twig index a0f3a10..eefee90 100755 --- a/templates/admin/user_index.html.twig +++ b/templates/admin/user_index.html.twig @@ -2,10 +2,10 @@ {% block body %}
-
+
Liste des utilisateurs
{{ include('partials/alerts.html.twig') }} @@ -30,7 +30,7 @@ {% for user in users %} - + {{ user.id }} diff --git a/templates/files/create_directory.html.twig b/templates/files/create_directory.html.twig index a42d360..3ae8dcd 100644 --- a/templates/files/create_directory.html.twig +++ b/templates/files/create_directory.html.twig @@ -2,7 +2,7 @@ {% block body %}
-
+

Créer un dossier dans /{{ basePath }}

{{ form(form) }}
diff --git a/templates/files/file_edit.html.twig b/templates/files/file_edit.html.twig index d333af0..ae8ad50 100644 --- a/templates/files/file_edit.html.twig +++ b/templates/files/file_edit.html.twig @@ -2,14 +2,14 @@ {% block body %}
-
+

Gérer les permissions du dossier {{ parentDir.name }}

{{ form_start(form) }} {{ form_row(form.ownerRole) }} {{ form_row(form.isPublic) }} {{ form_label(form.parentDirectoryPermissions) }} {{ form_widget(form.parentDirectoryPermissions) }} - + {{ form_end(form) }}
@@ -22,7 +22,7 @@ {% block javascripts %} {{ parent() }}