diff --git a/assets/css/app.css b/assets/css/app.css index 8c71781..fe14592 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -7,95 +7,71 @@ @import "./lightbox.css"; @layer base { - :root[data-theme=default] { - --color-primary: 68 68 68; - --color-background: 255 255 255; - --color-text-base: 68 68 68; - --color-text-heading: 68 68 68; - --color-text-muted: 153 153 153; - --color-text-dim: 204 204 204; + :root { font-family: 'Inter', sans-serif; } + @supports (font-variation-settings: normal) { + :root { font-family: 'Inter var', sans-serif; } } - :root[data-theme=default][data-mode=dark] { - --color-primary: 255 255 255; - --color-background: 34 34 34; - --color-text-base: 204 204 204; - --color-text-heading: 255 255 255; - --color-text-muted: 102 102 102; - --color-text-dim: 68 68 68; + :root { + --color-primary: 214 93 14; /* orange */ + --color-primary1: 175 58 3; /* orange faded */ + + --color-secondary: 104 157 106; /* aqua */ + --color-secondary1: 66 123 88; /* aqua faded */ + + --color-background: 253 244 193; /* light0 */ + --color-background1: 235 219 178; /* light1 */ + + --color-foreground: 60 56 54; /* dark1 */ + --color-foreground1: 80 73 69; /* dark2 */ + + --color-heading: var(--color-secondary); + --color-code: var(--color-background1); + + @apply selection:bg-theme-primary/50; } - :root[data-theme=frame] { - --color-primary: 91 82 254; - --color-background: 237 238 242; - --color-text-base: 38 43 55; - --color-text-heading: 57 65 83; - --color-text-muted: 57 65 83; - --color-text-dim: 76 87 111; + :root[data-mode=dark] { + --color-primary: 214 93 14; /* orange */ + --color-primary1: 254 128 25; /* orange bright */ + + --color-secondary: 104 157 106; /* aqua */ + --color-secondary1: 142 192 124; /* aqua faded */ + + --color-background: 40 40 40; /* dark0 */ + --color-background1: 60 56 54; /* dark1 */ + + --color-foreground: 235 219 178; /* light1 */ + --color-foreground1: 213 196 161; /* light2 */ + + --color-heading: var(--color-secondary); + --color-code: var(--color-base); } - :root[data-theme=frame][data-mode=dark] { - --color-primary: 91 82 254; - --color-background: 38 43 55; - --color-text-base: 204 204 204; - --color-text-heading: 204 204 204; - --color-text-muted: 76 87 111; - --color-text-dim: 57 65 83; - } - - :root[data-theme=gruvbox] { - --color-primary: 175 58 3; - --color-background: 251 241 199; - --color-text-base :40 40 40; - --color-text-heading: 66 123 88; - --color-text-muted: 60 56 54; - --color-text-dim: 102 92 84; - } - - :root[data-theme=gruvbox][data-mode=dark] { - --color-primary: 214 93 14; - --color-background: 40 40 40; - --color-text-base: 251 241 199; - --color-text-heading: 104 157 106; - --color-text-muted: 235 219 178; - --color-text-dim: 189 174 147; + :root[data-mode=dark] .prose { + @apply prose-invert; } } -/* - Invert prose styles based on the variant of the theme. -*/ -:root[data-mode=dark] .prose { - @apply prose-invert; -} +@layer components { + /* Set width and color for identity icons */ + a[rel] svg { + width: 1em; + fill: rgb(var(--color-primary)); + } + svg { + width: 1.5em; + } -.prose :where(a):not(:where([class~="not-prose"] *)) { - @apply underline decoration-1 decoration-theme-primary; -} + .alert { + @apply p-3 mt-3 rounded; + } -.prose :where(h2):not(:where([class~="not-prose"] *)) { - @apply font-serif text-theme-heading; -} + .alert.alert-danger { + @apply bg-red-100 text-red-500 dark:bg-red-950 dark:text-red-500; + } -.prose img { - @apply rounded border border-theme-dim; -} - -/* Set width and color for identity icons */ -a[rel] svg { - width: 1em; - fill: rgb(var(--color-primary)); -} - -/* Set width and color for identity icons */ -svg { - width: 1.5em; -} - -.alert { - @apply p-3 mt-3 rounded; -} - -.alert-danger { - @apply bg-red-100 text-red-500 dark:bg-red-950 dark:text-red-500; + .prose a { + @apply underline decoration-2 decoration-theme-primary hover:bg-theme-primary hover:text-theme-background transition; + } } \ No newline at end of file diff --git a/assets/css/lolight.css b/assets/css/lolight.css index 7ff1fde..f46c24d 100644 --- a/assets/css/lolight.css +++ b/assets/css/lolight.css @@ -1,23 +1,22 @@ .ll-nam { /* words */ - color: #2196f3; - @apply text-code-500; + @apply text-theme-code; } .ll-num { /* numbers */ - @apply text-code-400; + @apply text-theme-code; } .ll-str { /* strings */ - @apply text-code-600; + @apply text-theme-code; } .ll-rex { /* regular expressions */ - @apply text-code-600; + @apply text-theme-code; } .ll-pct { /* operators, punctation */ - @apply text-code-200; + @apply text-theme-code; } .ll-key { /* keywords */ - @apply text-code-300 font-bold; + @apply text-theme-code font-bold; } .ll-com { /* comments */ - @apply text-code-100; + @apply text-theme-code; font-style: italic; } diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index c359830..d5ff1cf 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -15,16 +15,37 @@ module.exports = { darkMode: ['class', '[data-mode="dark"]'], theme: { extend: { + typography: { + gruvbox: { + css: { + '--tw-prose-body': 'rgb(var(--color-foreground))', + '--tw-prose-links': 'rgb(var(--color-foreground))', + '--tw-prose-headings': 'rgb(var(--color-foreground))', + '--tw-prose-bold': 'rgb(var(--color-foreground))', + '--tw-prose-quotes': 'rgb(var(--color-foreground))', + '--tw-prose-bullets': 'rgb(var(--color-primary))', + '--tw-prose-quote-borders': 'rgb(var(--color-primary))', + '--tw-prose-invert-body': 'rgb(var(--color-foreground))', + '--tw-prose-invert-links': 'rgb(var(--color-foreground))', + '--tw-prose-invert-headings': 'rgb(var(--color-foreground))', + '--tw-prose-invert-bold': 'rgb(var(--color-foreground))', + '--tw-prose-invert-quotes': 'rgb(var(--color-foreground))', + '--tw-prose-invert-bullets': 'rgb(var(--color-primary))', + '--tw-prose-invert-quote-borders': 'rgb(var(--color-primary))' + } + } + }, colors: { code: colors.emerald, gray: colors.zinc, theme: { - primary: 'rgb(var(--color-primary) / )', - heading: 'rgb(var(--color-text-heading) / )', - base: 'rgb(var(--color-text-base) / )', - muted: 'rgb(var(--color-text-muted) / )', background: 'rgb(var(--color-background) / )', - dim: 'rgb(var(--color-text-dim) / )' + background1: 'rgb(var(--color-background1) / )', + base: 'rgb(var(--color-foreground) / )', + base1: 'rgb(var(--color-foreground1) / )', + primary: 'rgb(var(--color-primary) / )', + heading: 'rgb(var(--color-heading) / )', + code: 'rgb(var(--color-code) / )' } } }, diff --git a/lib/chiya_web/components/layouts/app.html.heex b/lib/chiya_web/components/layouts/app.html.heex index 10b4e61..344d604 100644 --- a/lib/chiya_web/components/layouts/app.html.heex +++ b/lib/chiya_web/components/layouts/app.html.heex @@ -1,36 +1,42 @@
+ <% items = [ + %{ + path: ~p"/admin/notes", + icon: "hero-document-text-solid", + name: "Notes" + }, + %{ + path: ~p"/admin/comments", + icon: "hero-chat-bubble-oval-left-ellipsis-solid", + name: "Comments" + }, + %{ + path: ~p"/admin/channels", + icon: "hero-speaker-wave-solid", + name: "Channels" + }, + %{ + path: ~p"/admin/identities", + icon: "hero-user-solid", + name: "Identities" + }, + %{ + path: ~p"/admin/settings", + icon: "hero-wrench-screwdriver-solid", + name: "Settings" + } + ] %>
+ <%= for item <- items do %> <.link - href={~p"/admin/comments"} + href={item.path} class="text-xs font-semibold leading-6 text-gray-900 hover:text-gray-700 dark:text-gray-200" > - <.icon name="hero-document-text" class="w-4 h-4" /> Comments - - <.link - href={~p"/admin/notes"} - class="text-xs font-semibold leading-6 text-gray-900 hover:text-gray-700 dark:text-gray-200" - > - <.icon name="hero-document-text" class="w-4 h-4" /> Notes - - <.link - href={~p"/admin/channels"} - class="text-xs font-semibold leading-6 text-gray-900 hover:text-gray-700 dark:text-gray-200" - > - <.icon name="hero-speaker-wave" class="w-4 h-4" /> Channels - - <.link - href={~p"/admin/identities"} - class="text-xs font-semibold leading-6 text-gray-900 hover:text-gray-700 dark:text-gray-200" - > - <.icon name="hero-user" class="w-4 h-4" /> Identities - - <.link - href={~p"/admin/settings"} - class="text-xs font-semibold leading-6 text-gray-900 hover:text-gray-700 dark:text-gray-200" - > - <.icon name="hero-wrench-screwdriver" class="w-4 h-4" /> Settings + <.icon name={item.icon} class="w-4 h-4" /> + <%= item.name %> + <% end %>
diff --git a/lib/chiya_web/components/layouts/root_app.html.heex b/lib/chiya_web/components/layouts/root_app.html.heex index 5408a38..2cc9da7 100644 --- a/lib/chiya_web/components/layouts/root_app.html.heex +++ b/lib/chiya_web/components/layouts/root_app.html.heex @@ -10,6 +10,8 @@ <.favicon /> + + diff --git a/lib/chiya_web/components/layouts/root_public.html.heex b/lib/chiya_web/components/layouts/root_public.html.heex index fa52f29..e160a9c 100644 --- a/lib/chiya_web/components/layouts/root_public.html.heex +++ b/lib/chiya_web/components/layouts/root_public.html.heex @@ -10,6 +10,8 @@ <.favicon /> + + diff --git a/lib/chiya_web/controllers/page_html/note.html.heex b/lib/chiya_web/controllers/page_html/note.html.heex index ab21d5b..a4ffeb7 100644 --- a/lib/chiya_web/controllers/page_html/note.html.heex +++ b/lib/chiya_web/controllers/page_html/note.html.heex @@ -1,6 +1,6 @@
-

+

<%= @note.name %>

@@ -9,10 +9,11 @@ <% else %> Unpublished <% end %> - + · Last Updated - + + <%= if not Enum.empty?(@note.tags) do %> · Tags @@ -20,14 +21,15 @@ <%= tag.name %> <% end %> + <% end %> <%= if @current_user do %> · - Edit + Edit <% end %>

-
+
<%= Markdown.render(@note.content) |> raw %>