From 54964d54d471a06d3a98209ab3ff15e83fbbbaeb Mon Sep 17 00:00:00 2001
From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Date: Wed, 5 Nov 2025 08:59:05 +0100
Subject: [PATCH] fix: clean up utility classes and improve readability in
Blade templates
---
resources/css/utilities.css | 6 +-
resources/views/layouts/app.blade.php | 25 +-
resources/views/layouts/base.blade.php | 422 +++++++++---------
.../project/application/general.blade.php | 80 ++--
4 files changed, 259 insertions(+), 274 deletions(-)
diff --git a/resources/css/utilities.css b/resources/css/utilities.css
index f5d173204..5d8a6bfa1 100644
--- a/resources/css/utilities.css
+++ b/resources/css/utilities.css
@@ -124,7 +124,7 @@ @utility menu {
}
@utility menu-item {
- @apply flex gap-3 items-center px-2 py-1 w-full text-sm sm:pr-0 dark:hover:bg-coolgray-100 dark:hover:text-white hover:bg-neutral-300 min-w-fit sm:min-w-64 text-black dark:text-neutral-400;
+ @apply flex gap-3 items-center px-2 py-1 w-full text-sm sm:pr-0 dark:hover:bg-coolgray-100 dark:hover:text-white hover:bg-neutral-300 min-w-fit sm:min-w-64;
}
@utility menu-item-active {
@@ -152,7 +152,7 @@ @utility custom-modal {
}
@utility navbar-main {
- @apply flex flex-col gap-4 justify-items-start pb-2 border-b-2 border-solid h-fit md:flex-row sm:justify-between dark:border-coolgray-200 border-neutral-200 md:items-center;
+ @apply flex flex-col gap-4 justify-items-start pb-2 border-b-2 border-solid h-fit md:flex-row sm:justify-between dark:border-coolgray-200 border-neutral-200 md:items-center text-neutral-700 dark:text-neutral-400;
}
@utility loading {
@@ -220,7 +220,7 @@ @utility title {
}
@utility subtitle {
- @apply pt-2 pb-9 text-neutral-500 dark:text-neutral-400;
+ @apply pt-2 pb-9;
}
@utility fullscreen {
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 01a128bd2..fae2e1b6d 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -9,16 +9,15 @@
@auth
+ open: false,
+ init() {
+ this.pageWidth = localStorage.getItem('pageWidth');
+ if (!this.pageWidth) {
+ this.pageWidth = 'full';
+ localStorage.setItem('pageWidth', 'full');
+ }
+ }
+ }" x-cloak class="mx-auto" :class="pageWidth === 'full' ? '' : 'max-w-7xl'">
@@ -56,8 +55,8 @@ class="text-xl font-bold tracking-wide dark:text-white hover:opacity-80 transiti
@@ -69,4 +68,4 @@ class="text-xl font-bold tracking-wide dark:text-white hover:opacity-80 transiti
@endauth
-@endsection
\ No newline at end of file
+@endsection
diff --git a/resources/views/layouts/base.blade.php b/resources/views/layouts/base.blade.php
index 0bb7a3c34..c577f7248 100644
--- a/resources/views/layouts/base.blade.php
+++ b/resources/views/layouts/base.blade.php
@@ -2,7 +2,7 @@
-
+ }
+ })
+ window.Livewire.on('info', (message) => {
+ if (typeof message === 'string') {
+ window.toast('Info', {
+ type: 'info',
+ description: message,
+ })
+ return;
+ }
+ if (message.length == 1) {
+ window.toast('Info', {
+ type: 'info',
+ description: message[0],
+ })
+ } else if (message.length == 2) {
+ window.toast(message[0], {
+ type: 'info',
+ description: message[1],
+ })
+ }
+ })
+ window.Livewire.on('error', (message) => {
+ if (typeof message === 'string') {
+ window.toast('Error', {
+ type: 'danger',
+ description: message,
+ })
+ return;
+ }
+ if (message.length == 1) {
+ window.toast('Error', {
+ type: 'danger',
+ description: message[0],
+ })
+ } else if (message.length == 2) {
+ window.toast(message[0], {
+ type: 'danger',
+ description: message[1],
+ })
+ }
+ })
+ window.Livewire.on('warning', (message) => {
+ if (typeof message === 'string') {
+ window.toast('Warning', {
+ type: 'warning',
+ description: message,
+ })
+ return;
+ }
+ if (message.length == 1) {
+ window.toast('Warning', {
+ type: 'warning',
+ description: message[0],
+ })
+ } else if (message.length == 2) {
+ window.toast(message[0], {
+ type: 'warning',
+ description: message[1],
+ })
+ }
+ })
+ window.Livewire.on('success', (message) => {
+ if (typeof message === 'string') {
+ window.toast('Success', {
+ type: 'success',
+ description: message,
+ })
+ return;
+ }
+ if (message.length == 1) {
+ window.toast('Success', {
+ type: 'success',
+ description: message[0],
+ })
+ } else if (message.length == 2) {
+ window.toast(message[0], {
+ type: 'success',
+ description: message[1],
+ })
+ }
+ })
+ });
+
+