File tree Expand file tree Collapse file tree 2 files changed +46
-3
lines changed Expand file tree Collapse file tree 2 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 20
20
}
21
21
}
22
22
23
- @layer utils {
23
+ @layer utilities {
24
24
.hide-scrollbar ::-webkit-scrollbar {
25
25
display : none;
26
26
}
29
29
-ms-overflow-style : none;
30
30
scrollbar-width : none;
31
31
}
32
+
33
+ /* this is used by alpine.js to properly hide elements on load */
34
+ [x-cloak ] {
35
+ @apply hidden;
36
+ }
32
37
}
Original file line number Diff line number Diff line change 1
- <div class =" modal fixed inset-0 flex justify-center overflow-y-scroll" >
2
- <div class =" absolute inset-0 bg-slate-800/80 backdrop-blur-sm" ></div >
1
+ @props ([
2
+ ' name' ,
3
+ ' show' => false ,
4
+ ] )
5
+
6
+ <div
7
+ x-data =" {
8
+ show: @js ($show ),
9
+ }"
10
+ x-show =" show"
11
+ x-on:open-modal.window ="
12
+ if ($event.detail === '{{ $name } } ') {
13
+ show = true
14
+ }
15
+ "
16
+ x-on:close-modal.window ="
17
+ if ($event.detail === '{{ $name } } ') {
18
+ show = false
19
+ }
20
+ "
21
+ x-init ="
22
+ $watch('show', (show) => {
23
+ if (show) {
24
+ document.body.classList.add('overflow-hidden')
25
+ } else {
26
+ document.body.classList.remove('overflow-hidden')
27
+ }
28
+ })
29
+ "
30
+ x-cloak
31
+ @class ([
32
+ ' flex' => $show ,
33
+ ' hidden' => " $show " ,
34
+ ' fixed inset-0 flex justify-center overflow-y-scroll' ,
35
+ ] )
36
+ >
37
+ <div
38
+ @click =" show = false"
39
+ class =" absolute inset-0 bg-slate-800/80 backdrop-blur-sm"
40
+ ></div >
3
41
{{ $slot } }
4
42
</div >
You can’t perform that action at this time.
0 commit comments