Skip to content

Commit ef75b5e

Browse files
Add footer style to custom theme classes (#1733)
1 parent 1a0ad8d commit ef75b5e

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

resources/views/components/frameworks/bootstrap5/footer.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
count(data_get($setUp, 'footer.perPageValues')) > 1 &&
55
blank(data_get($setUp, 'footer.pagination')))
66
<footer
7-
class="mt-50 pb-1 w-100 align-items-end px-1 d-flex flex-wrap justify-content-sm-center justify-content-md-between"
7+
class="{{ theme_style($theme, 'footer.footer', 'mt-50 pb-1 w-100 align-items-end px-1 d-flex flex-wrap justify-content-sm-center justify-content-md-between') }}"
88
>
99
<div class="col-auto overflow-auto my-sm-2 my-md-0 ms-sm-0">
1010
@if (filled(data_get($setUp, 'footer.perPage')) && count(data_get($setUp, 'footer.perPageValues')) > 1)

resources/views/components/frameworks/tailwind/footer.blade.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<div>
22
@includeIf(data_get($setUp, 'footer.includeViewOnTop'))
3-
<div
3+
<footer
44
id="pg-footer"
55
@class([
66
'justify-between' => filled(data_get($setUp, 'footer.perPage')),
77
'justify-end' => blank(data_get($setUp, 'footer.perPage')),
8-
'border-x border-b rounded-b-lg border-b border-pg-primary-200 dark:bg-pg-primary-700 dark:border-pg-primary-600',
9-
'md:flex md:flex-row w-full items-center py-3 bg-white overflow-y-auto pl-2 pr-2 relative dark:bg-pg-primary-900' => blank(
10-
data_get($setUp, 'footer.pagination')),
8+
theme_style($theme, 'footer.footer', 'border-x border-b rounded-b-lg border-b border-pg-primary-200 dark:bg-pg-primary-700 dark:border-pg-primary-600'),
9+
theme_style($theme, 'footer.footer_with_pagination', 'md:flex md:flex-row w-full items-center py-3 bg-white overflow-y-auto pl-2 pr-2 relative dark:bg-pg-primary-900') => blank(data_get($setUp, 'footer.pagination')),
1110
])
1211
>
1312
@if (filled(data_get($setUp, 'footer.perPage')) &&
@@ -53,6 +52,6 @@ class="pl-4 hidden sm:block md:block lg:block w-full"
5352
@endif
5453
</div>
5554
@endif
56-
</div>
55+
</footer>
5756
@includeIf(data_get($setUp, 'footer.includeViewOnBottom'))
5857
</div>

src/Themes/Bootstrap5.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ public function cols(): array
4949
public function footer(): array
5050
{
5151
return [
52-
'view' => $this->root() . '.footer',
53-
'select' => '',
52+
'view' => $this->root() . '.footer',
53+
'select' => '',
54+
'footer' => 'mt-50 pb-1 w-100 align-items-end px-1 d-flex flex-wrap justify-content-sm-center justify-content-md-between',
55+
'footer_with_pagination' => '',
5456
];
5557
}
5658

src/Themes/Tailwind.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ public function table(): array
4242
public function footer(): array
4343
{
4444
return [
45-
'view' => $this->root() . '.footer',
46-
'select' => 'appearance-none !bg-none focus:ring-primary-600 focus-within:focus:ring-primary-600 focus-within:ring-primary-600 dark:focus-within:ring-primary-600 flex rounded-md ring-1 transition focus-within:ring-2 dark:ring-pg-primary-600 dark:text-pg-primary-300 text-gray-600 ring-gray-300 dark:bg-pg-primary-800 bg-white dark:placeholder-pg-primary-400 rounded-md border-0 bg-transparent py-1.5 px-4 pr-7 ring-0 placeholder:text-gray-400 focus:outline-none sm:text-sm sm:leading-6 w-auto',
45+
'view' => $this->root() . '.footer',
46+
'select' => 'appearance-none !bg-none focus:ring-primary-600 focus-within:focus:ring-primary-600 focus-within:ring-primary-600 dark:focus-within:ring-primary-600 flex rounded-md ring-1 transition focus-within:ring-2 dark:ring-pg-primary-600 dark:text-pg-primary-300 text-gray-600 ring-gray-300 dark:bg-pg-primary-800 bg-white dark:placeholder-pg-primary-400 rounded-md border-0 bg-transparent py-1.5 px-4 pr-7 ring-0 placeholder:text-gray-400 focus:outline-none sm:text-sm sm:leading-6 w-auto',
47+
'footer' => 'border-x border-b rounded-b-lg border-b border-pg-primary-200 dark:bg-pg-primary-700 dark:border-pg-primary-600',
48+
'footer_with_pagination' => 'md:flex md:flex-row w-full items-center py-3 bg-white overflow-y-auto pl-2 pr-2 relative dark:bg-pg-primary-900',
4749
];
4850
}
4951

src/functions.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ function once(callable $callback): mixed
5050
}
5151

5252
if (!function_exists('theme_style')) {
53-
function theme_style(array $theme, string $name): string
53+
function theme_style(array $theme, string $name, ?string $default = null): string
5454
{
55-
return strval(data_get($theme, str($name)->append('.0')) ?? data_get($theme, $name));
55+
return strval(
56+
data_get($theme, str($name)->append('.0')) ?? data_get($theme, $name, $default)
57+
);
5658
}
5759
}

0 commit comments

Comments
 (0)