From ef0e89478cb90df60903bdd2d9bc6ef7537ff778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Diedrich?= Date: Mon, 25 Jul 2022 11:05:55 +0200 Subject: [PATCH] much style --- assets/css/app.css | 20 ++++++++++++----- assets/tailwind.config.js | 4 ++++ .../live/thread_live/show.html.heex | 22 +++++++++---------- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/assets/css/app.css b/assets/css/app.css index 4d35654..55b8afc 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -5,12 +5,15 @@ /* This file is for your main application CSS */ body { - @apply bg-neutral text-[14pt]; + @apply bg-base-300 text-[14pt] leading-8; } .post { - @apply bg-base-200 shadow-md rounded; - @apply flex mb-4 p-4 py-3 gap-4; + @apply bg-base-200 shadow-md rounded-md; + @apply flex mb-4; +} +.post :where(article, .userinfo) { + @apply p-4 pt-4; } .post .bbc-block { @@ -19,12 +22,19 @@ body { .post .bbc-block h4 { @apply text-sm mb-2; } -.post .bbc-spoiler { @apply bg-black; } +.post .bbc-spoiler { @apply bg-black text-black; } .post .bbc-spoiler img { @apply invisible; } +.post .bbc-spoiler:hover { @apply text-inherit bg-inherit; } .post .bbc-spoiler:hover img { @apply visible; } .post iframe { - @apply w-full; + @apply w-full bg-[brown]; } +.post .code { @apply mockup-code border-l-0; } +.post .code:before { @apply -ml-[2ch]; } +.post .code pre:before { @apply mr-0; } +.post .code h5 { @apply hidden; } +.post a[href] { @apply link; } +.post .editedby { @apply text-sm italic opacity-70 mt-4; } /* Alerts and form errors used by phx.new */ .alert { diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index 18ed004..349794b 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -9,6 +9,10 @@ module.exports = { theme: { extend: {}, }, + daisyui: { + themes: ["winter", "night"], + darkTheme: "night" + }, plugins: [ require('@tailwindcss/forms'), require('@tailwindcss/typography'), diff --git a/lib/something_erlang_web/live/thread_live/show.html.heex b/lib/something_erlang_web/live/thread_live/show.html.heex index 0da1380..1589b0d 100644 --- a/lib/something_erlang_web/live/thread_live/show.html.heex +++ b/lib/something_erlang_web/live/thread_live/show.html.heex @@ -11,18 +11,16 @@ <% end %> -

-<%= @thread.title %> -

+

+ <%= @thread.title %> +

-
- <%= for post <- @thread.posts do %> - <.post author={post.userinfo} article={post.postbody} /> - <% end %> -
+
+ <.pagination socket={@socket} thread={@thread} /> + <%= for post <- @thread.posts do %> + <.post author={post.userinfo} article={post.postbody} /> + <% end %> -<%= live_redirect "Back", to: Routes.thread_index_path(@socket, :index) %> -<%= @thread.page %> -<%= live_redirect "Next Page", class: "link", - to: Routes.thread_show_path(@socket, :show, @thread.id, page: @thread.page+1) %> + <.pagination socket={@socket} thread={@thread} /> +