Skip to content

Commit bd32334

Browse files
jhashclaude
andauthored
Transform app styling to pastel purple theme with NYT-inspired design (#16)
- Add custom Tailwind configuration with purple color palette - Integrate Google Fonts (Playfair Display, Crimson Text, Source Sans 3) - Replace all blue UI elements with purple equivalents - Implement dark mode support with toggle in user dropdown - Add paper-colored background for classic article aesthetic - Update typography for NYT-inspired article presentation - Enhance blog post views with improved readability - Fix Tailwind build issues by removing \!important declarations - Add dark mode variants throughout the application 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2ff65b9 commit bd32334

17 files changed

Lines changed: 287 additions & 146 deletions

app/assets/stylesheets/actiontext.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,11 +377,11 @@ trix-editor blockquote::before,
377377
@apply inline-block relative max-w-full;
378378
}
379379
.trix-content .attachment a {
380-
@apply text-inherit no-underline !important;
380+
@apply text-inherit no-underline;
381381
}
382382
.trix-content .attachment a:hover,
383383
.trix-content .attachment a:visited:hover {
384-
@apply text-inherit !important;
384+
@apply text-inherit;
385385
}
386386
.trix-content .attachment__caption {
387387
@apply text-center;
@@ -425,8 +425,8 @@ trix-editor blockquote::before,
425425
}
426426

427427
.trix-content action-text-attachment .attachment {
428-
padding: 0 !important;
429-
max-width: 100% !important;
428+
padding: 0;
429+
max-width: 100%;
430430
}
431431

432432
/* Custom heading styles for Trix editor - matching public view */
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div class="px-6 py-4 border-b border-gray-200">
1+
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
22
<div class="flex items-center justify-between">
33
<div>
4-
<h1 class="text-2xl font-semibold text-gray-900"><%= title %></h1>
4+
<h1 class="text-2xl font-semibold text-gray-900 dark:text-gray-100"><%= title %></h1>
55
<% if description.present? %>
6-
<p class="mt-1 text-sm text-gray-600"><%= description %></p>
6+
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400"><%= description %></p>
77
<% end %>
88
</div>
99
<% if action_text.present? && action_path.present? %>
1010
<%= link_to action_text, action_path,
11-
class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition-colors" %>
11+
class: "bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-md transition-colors" %>
1212
<% end %>
1313
</div>
1414
</div>

app/components/navbar_component.html.erb

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<nav class="bg-gray-900 text-white shadow-lg">
1+
<nav class="bg-purple-900 text-white shadow-lg dark:bg-purple-950">
22
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
33
<div class="flex justify-between h-16">
44
<div class="flex items-center">
55
<% if current_user %>
66
<button type="button"
7-
class="mr-3 p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 lg:hidden"
7+
class="mr-3 p-2 rounded-md text-purple-200 hover:text-white hover:bg-purple-800 lg:hidden"
88
aria-haspopup="true"
99
aria-expanded="false"
1010
aria-controls="sidebar-menu"
@@ -15,7 +15,7 @@
1515
</svg>
1616
</button>
1717
<% end %>
18-
<%= link_to "Eight", root_path, class: "text-xl font-bold hover:text-gray-300 transition-colors" %>
18+
<%= link_to "Eight", root_path, class: "text-xl font-display font-bold hover:text-purple-200 transition-colors" %>
1919
</div>
2020

2121
<div class="flex items-center space-x-4">
@@ -25,38 +25,48 @@
2525
<% if current_user %>
2626
<div class="relative" data-controller="dropdown">
2727
<button type="button"
28-
class="flex items-center justify-center w-10 h-10 rounded-full bg-gray-700 hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-white transition-colors"
28+
class="flex items-center justify-center w-10 h-10 rounded-full bg-purple-700 hover:bg-purple-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-purple-900 focus:ring-purple-300 transition-colors"
2929
data-action="click->dropdown#toggle click@window->dropdown#hide"
3030
aria-expanded="false"
3131
aria-haspopup="true">
3232
<span class="text-sm font-medium"><%= user_initials %></span>
3333
</button>
3434

35-
<div class="dropdown-menu absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5"
35+
<div class="dropdown-menu absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white dark:bg-gray-800 ring-1 ring-black ring-opacity-5"
3636
data-dropdown-target="menu"
3737
role="menu"
3838
aria-orientation="vertical"
3939
aria-labelledby="user-menu">
40-
<div class="px-4 py-2 border-b border-gray-200">
41-
<p class="text-sm font-medium text-gray-900"><%= current_user.name %></p>
42-
<p class="text-xs text-gray-500"><%= current_user.email %></p>
40+
<div class="px-4 py-2 border-b border-gray-200 dark:border-gray-700">
41+
<p class="text-sm font-medium text-gray-900 dark:text-gray-100"><%= current_user.name %></p>
42+
<p class="text-xs text-gray-500 dark:text-gray-400"><%= current_user.email %></p>
4343
</div>
4444

4545
<%= link_to "Settings", settings_path,
46-
class: "block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",
46+
class: "block px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",
4747
role: "menuitem" %>
4848

49-
<div class="border-t border-gray-200">
49+
<form action="#" method="POST" data-turbo="false" class="px-4 py-2">
50+
<label class="flex items-center justify-between cursor-pointer">
51+
<span class="text-sm text-gray-700 dark:text-gray-200">Dark Mode</span>
52+
<input type="checkbox" name="dark_mode"
53+
class="sr-only peer"
54+
onchange="document.documentElement.classList.toggle('dark'); localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'))">
55+
<div class="relative w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-purple-300 dark:peer-focus:ring-purple-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-purple-600"></div>
56+
</label>
57+
</form>
58+
59+
<div class="border-t border-gray-200 dark:border-gray-700">
5060
<%= button_to "Sign Out", logout_path, method: :delete,
51-
class: "block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",
61+
class: "block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700",
5262
data: { turbo: false },
5363
role: "menuitem" %>
5464
</div>
5565
</div>
5666
</div>
5767
<% else %>
5868
<%= link_to "Sign in", sign_in_path,
59-
class: "bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm transition-colors" %>
69+
class: "bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded text-sm transition-colors" %>
6070
<% end %>
6171
</div>
6272
</div>

app/components/sidebar_component.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<aside id="sidebar-menu" class="bg-gray-800 text-white min-h-screen flex flex-col fixed lg:static inset-y-0 left-0 z-40 transform -translate-x-full lg:translate-x-0 transition-transform duration-300 ease-in-out" role="menu" aria-label="Main navigation">
1+
<aside id="sidebar-menu" class="bg-purple-800 dark:bg-purple-950 text-white min-h-screen flex flex-col fixed lg:static inset-y-0 left-0 z-40 transform -translate-x-full lg:translate-x-0 transition-transform duration-300 ease-in-out" role="menu" aria-label="Main navigation">
22
<div class="px-4 py-6">
33
<nav class="space-y-1" role="tree">
44
<% nav_items.each_with_index do |item, index| %>
55
<% if item[:children] %>
66
<details class="group" <%= "open" if any_child_active?(item[:children]) %>>
7-
<summary class="flex items-center px-3 py-2 text-sm font-medium rounded-md transition-colors cursor-pointer hover:bg-gray-700 list-none"
7+
<summary class="flex items-center px-3 py-2 text-sm font-medium rounded-md transition-colors cursor-pointer hover:bg-purple-700 dark:hover:bg-purple-800 list-none"
88
role="treeitem"
99
aria-expanded="<%= any_child_active?(item[:children]) ? 'true' : 'false' %>"
1010
tabindex="0">
@@ -37,7 +37,7 @@
3737
</div>
3838

3939
<% if sidebar_filters.present? %>
40-
<div class="px-4 py-6 border-t border-gray-700">
40+
<div class="px-4 py-6 border-t border-purple-700 dark:border-purple-800">
4141
<%= sidebar_filters %>
4242
</div>
4343
<% end %>

app/components/sidebar_component.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def any_child_active?(children)
4545
def item_classes(item)
4646
base = "flex items-center px-3 py-2 text-sm font-medium rounded-md transition-colors"
4747
if is_active?(item[:path])
48-
"#{base} bg-gray-900 text-white"
48+
"#{base} bg-purple-900 dark:bg-purple-800 text-white"
4949
else
50-
"#{base} text-gray-300 hover:bg-gray-700 hover:text-white"
50+
"#{base} text-purple-100 hover:bg-purple-700 dark:hover:bg-purple-800 hover:text-white"
5151
end
5252
end
5353

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<%= form_with(model: [:admin, blog_post]) do |form| %>
22
<% if blog_post.errors.any? %>
3-
<div class="mb-4 p-4 bg-red-50 border border-red-200 rounded-lg">
4-
<h3 class="text-sm font-medium text-red-800 mb-2">
3+
<div class="mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg">
4+
<h3 class="text-sm font-medium text-red-800 dark:text-red-200 mb-2">
55
<%= pluralize(blog_post.errors.count, "error") %> prohibited this blog post from being saved:
66
</h3>
7-
<ul class="list-disc list-inside text-sm text-red-700">
7+
<ul class="list-disc list-inside text-sm text-red-700 dark:text-red-300">
88
<% blog_post.errors.full_messages.each do |message| %>
99
<li><%= message %></li>
1010
<% end %>
@@ -15,81 +15,81 @@
1515
<div class="space-y-6">
1616
<div class="grid grid-cols-1 gap-6">
1717
<div>
18-
<%= form.label :title, class: "block text-sm font-medium text-gray-700" %>
18+
<%= form.label :title, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
1919
<%= form.text_field :title,
20-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
20+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
2121
</div>
2222

2323
<div>
24-
<%= form.label :slug, class: "block text-sm font-medium text-gray-700" %>
24+
<%= form.label :slug, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
2525
<%= form.text_field :slug,
26-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
26+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm",
2727
placeholder: "leave-blank-to-auto-generate" %>
28-
<p class="mt-1 text-sm text-gray-500">Leave blank to auto-generate from title</p>
28+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">Leave blank to auto-generate from title</p>
2929
</div>
3030

3131
<div>
32-
<%= form.label :excerpt, class: "block text-sm font-medium text-gray-700" %>
32+
<%= form.label :excerpt, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
3333
<%= form.text_area :excerpt, rows: 3,
34-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
34+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
3535
</div>
3636

3737
<div data-controller="trix-heading">
38-
<%= form.label :content, class: "block text-sm font-medium text-gray-700" %>
38+
<%= form.label :content, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
3939
<%= form.rich_text_area :content,
40-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
40+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
4141
</div>
4242

4343
<div class="grid grid-cols-2 gap-6">
4444
<div>
45-
<%= form.label :status, class: "block text-sm font-medium text-gray-700" %>
45+
<%= form.label :status, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
4646
<%= form.select :status, options_for_select(BlogPost.statuses.map {|key, value| [key.humanize, key]}, blog_post.status),
47-
{}, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
47+
{}, class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
4848
</div>
4949

5050
<div>
51-
<%= form.label :published_at, class: "block text-sm font-medium text-gray-700" %>
51+
<%= form.label :published_at, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
5252
<%= form.datetime_field :published_at,
53-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
53+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
5454
</div>
5555
</div>
5656

5757
<div>
58-
<%= form.label :tag_list, "Tags", class: "block text-sm font-medium text-gray-700" %>
58+
<%= form.label :tag_list, "Tags", class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
5959
<%= form.text_field :tag_list, value: blog_post.tag_list,
60-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",
60+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm",
6161
placeholder: "ruby, rails, web development" %>
62-
<p class="mt-1 text-sm text-gray-500">Separate tags with commas</p>
62+
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">Separate tags with commas</p>
6363
</div>
6464

6565
<div>
66-
<%= form.label :featured_image_url, class: "block text-sm font-medium text-gray-700" %>
66+
<%= form.label :featured_image_url, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
6767
<%= form.text_field :featured_image_url,
68-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
68+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
6969
</div>
7070

71-
<div class="border-t pt-6">
72-
<h3 class="text-lg font-medium text-gray-900 mb-4">SEO Metadata</h3>
71+
<div class="border-t dark:border-gray-700 pt-6">
72+
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">SEO Metadata</h3>
7373

7474
<div class="space-y-4">
7575
<div>
76-
<%= form.label :meta_title, class: "block text-sm font-medium text-gray-700" %>
76+
<%= form.label :meta_title, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
7777
<%= form.text_field :meta_title,
78-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
78+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
7979
</div>
8080

8181
<div>
82-
<%= form.label :meta_description, class: "block text-sm font-medium text-gray-700" %>
82+
<%= form.label :meta_description, class: "block text-sm font-medium text-gray-700 dark:text-gray-300" %>
8383
<%= form.text_area :meta_description, rows: 2,
84-
class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm" %>
84+
class: "mt-1 block w-full rounded-md border-gray-300 dark:border-gray-600 dark:bg-gray-700 dark:text-white shadow-sm focus:border-purple-500 focus:ring-purple-500 sm:text-sm" %>
8585
</div>
8686
</div>
8787
</div>
8888
</div>
8989

90-
<div class="flex items-center justify-end space-x-3 pt-6 border-t">
91-
<%= link_to "Cancel", admin_blog_posts_path, class: "bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %>
92-
<%= form.submit class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-md transition-colors" %>
90+
<div class="flex items-center justify-end space-x-3 pt-6 border-t dark:border-gray-700">
91+
<%= link_to "Cancel", admin_blog_posts_path, class: "bg-white dark:bg-gray-700 py-2 px-4 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500" %>
92+
<%= form.submit class: "bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-4 rounded-md transition-colors" %>
9393
</div>
9494
</div>
9595
<% end %>

0 commit comments

Comments
 (0)