diff --git a/assets/css/app.scss b/assets/css/app.scss index 4ed7fc3..d062fa6 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -28,42 +28,6 @@ $fa-font-path: "@fortawesome/fontawesome-free/webfonts"; pointer-events: none; } -.phx-modal { - opacity: 1!important; - position: fixed; - z-index: 1; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: auto; - background-color: rgb(0,0,0); - background-color: rgba(0,0,0,0.4); -} - -.phx-modal-content { - background-color: #fefefe; - margin: 15% auto; - padding: 20px; - border: 1px solid #888; - width: 80%; -} - -.phx-modal-close { - color: #aaa; - float: right; - font-size: 28px; - font-weight: bold; -} - -.phx-modal-close:hover, -.phx-modal-close:focus { - color: black; - text-decoration: none; - cursor: pointer; -} - - /* Alerts and form errors */ .alert { padding: 15px; diff --git a/lib/cannery_web/live/modal_component.ex b/lib/cannery_web/live/modal_component.ex index 019129d..11754d4 100644 --- a/lib/cannery_web/live/modal_component.ex +++ b/lib/cannery_web/live/modal_component.ex @@ -4,16 +4,30 @@ defmodule CanneryWeb.ModalComponent do @impl true def render(assigns) do ~L""" -
-
- <%= live_patch raw("×"), to: @return_to, class: "phx-modal-close" %> - <%= live_component @socket, @component, @opts %> +
+ <%# close button %> + <%= live_patch to: @return_to, + class: "absolute top-8 right-10 text-gray-500 hover:text-gray-800 + transition-all duration-500 ease-in-out" do %> + + <% end %> + + <%# modal content %> +
+ <%= live_component @socket, @component, @opts %> +
"""