Skip to content

Commit 8e04ea8

Browse files
committed
Mapped tailwind clases for generating grid columns in order to be compatible with the jit mode of tailwind 3
1 parent 1b4a522 commit 8e04ea8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

resources/views/grid-view/grid-view.blade.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,30 @@
66
You can customize all the html and css classes but YOU MUST KEEP THE BLADE AND LIVEWIERE DIRECTIVES
77
88
--}}
9-
9+
@php
10+
// Mapped this tailwindcss utilities so they can be prged
11+
$cols = [
12+
1 => 'xl:grid-cols-1',
13+
2 => 'xl:grid-cols-2',
14+
3 => 'xl:grid-cols-3',
15+
4 => 'xl:grid-cols-4',
16+
5 => 'xl:grid-cols-5',
17+
6 => 'xl:grid-cols-6',
18+
7 => 'xl:grid-cols-7',
19+
8 => 'xl:grid-cols-8',
20+
9 => 'xl:grid-cols-9',
21+
10 => 'xl:grid-cols-10',
22+
11 => 'xl:grid-cols-11',
23+
12 => 'xl:grid-cols-12',
24+
]
25+
@endphp
1026
<x-lv-layout>
1127
{{-- Search input and filters --}}
1228
<div class="mb-2">
1329
@include('laravel-views::components.toolbar.toolbar')
1430
</div>
1531

16-
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-{{ $maxCols }} gap-8 md:gap-8">
32+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 {{ $cols[$maxCols] }} gap-8 md:gap-8">
1733
@foreach ($items as $item)
1834
<div class="relative">
1935
@if ($this->hasBulkActions)

0 commit comments

Comments
 (0)