From 843bcd8cb91bb1124f9e6476f95ccd83deb2250b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 29 May 2025 15:43:28 +0400 Subject: [PATCH] Remove special link class This cleans up the code quite a bit, but also allows links in editable content to be rendered with the default style. --- .../stylesheets/application.tailwind.css | 1 - app/assets/stylesheets/components/base.css | 8 ++++++++ app/assets/stylesheets/components/buttons.css | 19 +++++++++++++++--- app/assets/stylesheets/components/links.css | 8 -------- .../stylesheets/components/pagination.css | 2 +- .../admin/app_catalog/web_apps/index.html.erb | 3 +-- app/views/admin/donations/_list.html.erb | 2 +- app/views/admin/donations/show.html.erb | 2 +- app/views/admin/invitations/index.html.erb | 4 ++-- app/views/admin/lightning/index.html.erb | 2 +- app/views/admin/users/index.html.erb | 2 +- app/views/admin/users/show.html.erb | 10 +++++----- app/views/dashboard/index.html.erb | 20 ++++++++++--------- app/views/rs/oauth/new.html.erb | 2 +- app/views/services/email/show.html.erb | 2 +- app/views/services/lightning/index.html.erb | 10 +++++----- app/views/services/mastodon/show.html.erb | 2 +- .../services/remotestorage/show.html.erb | 4 ++-- 18 files changed, 58 insertions(+), 45 deletions(-) delete mode 100644 app/assets/stylesheets/components/links.css diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index e679da8..bba2f9b 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -7,7 +7,6 @@ @import "components/buttons"; @import "components/dashboard_services"; @import "components/forms"; -@import "components/links"; @import "components/notifications"; @import "components/pagination"; @import "components/tables"; diff --git a/app/assets/stylesheets/components/base.css b/app/assets/stylesheets/components/base.css index a9e082e..eb9f75c 100644 --- a/app/assets/stylesheets/components/base.css +++ b/app/assets/stylesheets/components/base.css @@ -6,6 +6,7 @@ body { @apply leading-none bg-cover bg-fixed; background-image: linear-gradient(35deg, rgba(255,0,255,0.2) 0, rgba(13,79,153,0.8) 100%), url('/img/bg-1.jpg'); + color: black; } body#admin { @@ -59,4 +60,11 @@ main ul li { @apply leading-6; } + + main section a:not(nav > *):not(data-tabs-target=[tab] > *) { + @apply text-blue-600; + &:hover { @apply underline; } + &:visited { @apply text-indigo-600; } + &:active { @apply text-red-600; } + } } diff --git a/app/assets/stylesheets/components/buttons.css b/app/assets/stylesheets/components/buttons.css index 34fb68c..5bb4198 100644 --- a/app/assets/stylesheets/components/buttons.css +++ b/app/assets/stylesheets/components/buttons.css @@ -1,5 +1,15 @@ @layer components { + .btn-text-dark { @apply text-black; } + .btn-text-dark:hover { @apply text-black no-underline; } + .btn-text-dark:visited { @apply text-black; } + .btn-text-dark:active { @apply text-black; } + .btn-text-light { @apply text-white; } + .btn-text-light:hover { @apply text-white no-underline; } + .btn-text-light:visited { @apply text-white; } + .btn-text-light:active { @apply text-white; } + .btn { + @apply btn-text-dark; @apply inline-block font-semibold rounded-md leading-none cursor-pointer text-center transition-colors duration-75 focus:outline-none focus:ring-4; } @@ -28,17 +38,20 @@ } .btn-blue { - @apply bg-blue-500 hover:bg-blue-600 text-white + @apply btn-text-light; + @apply bg-blue-500 hover:bg-blue-600 focus:ring-blue-400 focus:ring-opacity-75; } .btn-emerald { - @apply bg-emerald-500 hover:bg-emerald-600 text-white + @apply btn-text-light; + @apply bg-emerald-500 hover:bg-emerald-600 focus:ring-emerald-400 focus:ring-opacity-75; } .btn-red { - @apply bg-red-600 hover:bg-red-700 text-white + @apply btn-text-light; + @apply bg-red-600 hover:bg-red-700 focus:ring-red-500 focus:ring-opacity-75; } diff --git a/app/assets/stylesheets/components/links.css b/app/assets/stylesheets/components/links.css deleted file mode 100644 index 92c9c75..0000000 --- a/app/assets/stylesheets/components/links.css +++ /dev/null @@ -1,8 +0,0 @@ -@layer components { - .ks-text-link { - @apply text-blue-600; - &:hover { @apply underline; } - &:visited { @apply text-indigo-600; } - &:active { @apply text-red-600; } - } -} diff --git a/app/assets/stylesheets/components/pagination.css b/app/assets/stylesheets/components/pagination.css index f6ab6c6..38fffbf 100644 --- a/app/assets/stylesheets/components/pagination.css +++ b/app/assets/stylesheets/components/pagination.css @@ -34,7 +34,7 @@ .pagy-nav .page a, .page.gap { @apply bg-white border-gray-300 text-gray-500 hover:bg-gray-100 relative inline-flex items-center border px-4 py-2 text-sm font-medium - focus:z-20; + no-underline focus:z-20; } .pagy-nav .page.active { diff --git a/app/views/admin/app_catalog/web_apps/index.html.erb b/app/views/admin/app_catalog/web_apps/index.html.erb index ebfa289..d904b0d 100644 --- a/app/views/admin/app_catalog/web_apps/index.html.erb +++ b/app/views/admin/app_catalog/web_apps/index.html.erb @@ -38,8 +38,7 @@ <%= web_app.name %> <%= link_to web_app.url, web_app.url, - target: "_blank", rel: "nofollow noopener", - class: "ks-text-link" %> + target: "_blank", rel: "nofollow noopener" %> <%= web_app.remote_storage_authorizations.count %> diff --git a/app/views/admin/donations/_list.html.erb b/app/views/admin/donations/_list.html.erb index aa405ec..b9009d7 100644 --- a/app/views/admin/donations/_list.html.erb +++ b/app/views/admin/donations/_list.html.erb @@ -12,7 +12,7 @@ <% donations.each do |donation| %> - <%= link_to donation.user.cn, admin_user_path(donation.user.cn), class: 'ks-text-link' %> + <%= link_to donation.user.cn, admin_user_path(donation.user.cn) %> <% if donation.amount_sats.present? %><%= number_with_delimiter donation.amount_sats %><% end %> <% if donation.fiat_amount.present? %><%= number_to_currency donation.fiat_amount.to_f / 100, unit: "" %> <%= donation.fiat_currency %><% end %> <%= donation.public_name %> diff --git a/app/views/admin/donations/show.html.erb b/app/views/admin/donations/show.html.erb index 3e3ad65..089b855 100644 --- a/app/views/admin/donations/show.html.erb +++ b/app/views/admin/donations/show.html.erb @@ -6,7 +6,7 @@ User - <%= link_to @donation.user.cn, admin_user_path(@donation.user.cn), class: 'ks-text-link' %> + <%= link_to @donation.user.cn, admin_user_path(@donation.user.cn) %> Donation Method diff --git a/app/views/admin/invitations/index.html.erb b/app/views/admin/invitations/index.html.erb index acc5606..c984f6d 100644 --- a/app/views/admin/invitations/index.html.erb +++ b/app/views/admin/invitations/index.html.erb @@ -44,8 +44,8 @@ <%= invitation.token %> <%= invitation.used_at.strftime("%Y-%m-%d (%H:%M UTC)") %> - <%= link_to invitation.user.cn, admin_user_path(invitation.user.cn), class: "ks-text-link" %> - <%= link_to invitation.invitee.cn, admin_user_path(invitation.invitee.cn), class: "ks-text-link" %> + <%= link_to invitation.user.cn, admin_user_path(invitation.user.cn) %> + <%= link_to invitation.invitee.cn, admin_user_path(invitation.invitee.cn) %> <% end %> diff --git a/app/views/admin/lightning/index.html.erb b/app/views/admin/lightning/index.html.erb index 9240148..cfea8e6 100644 --- a/app/views/admin/lightning/index.html.erb +++ b/app/views/admin/lightning/index.html.erb @@ -36,7 +36,7 @@ <% if user = @users.find{ |u| u[2] == account.login } %> - <%= link_to user[0], admin_user_path(user[0]), class: "ks-text-link" %> + <%= link_to user[0], admin_user_path(user[0]) %> <% end %> <%= number_with_delimiter account.balance.to_i.to_s %> diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index 66bf6f6..413ec2b 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -42,7 +42,7 @@ <% @users.each do |user| %> - <%= link_to(user.cn, admin_user_path(user.cn), class: 'ks-text-link') %> + <%= link_to(user.cn, admin_user_path(user.cn)) %> <%= user.confirmed_at.nil? ? badge("pending", :yellow) : "" %> <% if @show_contributors %><%= @contributors.include?(user.cn) ? badge("contributor", :green) : "" %><% end %> diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb index 94c21dd..01aaf12 100644 --- a/app/views/admin/users/show.html.erb +++ b/app/views/admin/users/show.html.erb @@ -47,7 +47,7 @@ Donations <% if @user.donations.any? %> - <%= link_to admin_donations_path(username: @user.cn), class: "ks-text-link" do %> + <%= link_to admin_donations_path(username: @user.cn) do %> <%= @user.donations.completed.count %> for <%= number_with_delimiter @user.donations.completed.sum("amount_sats") %> sats <% end %> @@ -60,7 +60,7 @@ Invited by <% if @user.inviter %> - <%= link_to @user.inviter.cn, admin_user_path(@user.inviter.cn), class: 'ks-text-link' %> + <%= link_to @user.inviter.cn, admin_user_path(@user.inviter.cn) %> <% else %>—<% end %> @@ -102,10 +102,10 @@ <% if @invitees.any? %> <% else %>—<% end %> @@ -168,7 +168,7 @@ <% if @user.pgp_pubkey_contains_user_address? %> <%= link_to wkd_key_url(hashed_username: @user.wkd_hash, l: @user.cn, format: :txt), - class: "ks-text-link", target: "_blank" do %> + target: "_blank" do %> <%= "#{@user.pgp_fpr[0, 8]}…#{@user.pgp_fpr[-8..-1]}" %> <% end %> <% else %> diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 576606b..fc44512 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -8,7 +8,7 @@ bg-[length:86%] bg-[center_top_-40px] bg-no-repeat bg-[url(/img/logos/icon_xmpp.svg)]"> <%= link_to services_chat_path, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Chat

Federated chat rooms and instant messaging @@ -20,7 +20,8 @@

- <%= link_to services_mastodon_path, class: "block h-full px-6 py-6 rounded-md" do %> + <%= link_to services_mastodon_path, + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Mastodon

Your account on the Open Social Web @@ -33,7 +34,8 @@

- <%= link_to services_email_path, class: "block h-full px-6 py-6 rounded-md" do %> + <%= link_to services_email_path, + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

E-Mail

A no-bullshit email account @@ -47,7 +49,7 @@ bg-[length:80%] bg-[center_top_-156px] bg-no-repeat bg-[url(/img/logos/icon_remotestorage.svg)]"> <%= link_to services_storage_path, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Storage

Sync your data between apps and devices @@ -60,7 +62,7 @@ bg-cover bg-center sm:bg-[center_top_-140px] bg-no-repeat bg-[url(/img/logos/icon_lightning.svg)]"> <%= link_to services_lightning_index_path, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Lightning Network

Send and receive sats over the Bitcoin Lightning Network @@ -73,7 +75,7 @@ bg-[length:80%] bg-center bg-no-repeat bg-[url(/img/logos/icon_discourse.svg)]"> <%= link_to "#{Setting.discourse_public_url}/session/sso?return_path=/", - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Discourse

Community forums and support/help site @@ -86,7 +88,7 @@ bg-[length:92%] bg-center bg-no-repeat bg-[url(/img/logos/icon_gitea.png)]"> <%= link_to Setting.gitea_public_url, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Gitea

Code hosting and collaboration for software projects @@ -99,7 +101,7 @@ bg-[length:86%] bg-[center_top_-60px] bg-no-repeat bg-[url(/img/logos/icon_droneci.svg)]"> <%= link_to Setting.droneci_public_url, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Drone CI

Continuous integration for software projects on Gitea @@ -112,7 +114,7 @@ bg-cover bg-[center_top_-20px] bg-no-repeat bg-[url(/img/logos/icon_mediawiki.svg)]"> <%= link_to Setting.mediawiki_public_url, - class: "block h-full px-6 py-6 rounded-md" do %> + class: "block h-full px-6 py-6 rounded-md btn-text-dark" do %>

Wiki

Documentation and knowledge base diff --git a/app/views/rs/oauth/new.html.erb b/app/views/rs/oauth/new.html.erb index 3d63f81..8cb9498 100644 --- a/app/views/rs/oauth/new.html.erb +++ b/app/views/rs/oauth/new.html.erb @@ -4,7 +4,7 @@

The app on - <%= link_to @client_id, "https://#{@client_id}", class: "ks-text-link" %> + <%= link_to @client_id, "https://#{@client_id}" %> is asking for access to these folders:

diff --git a/app/views/services/email/show.html.erb b/app/views/services/email/show.html.erb index 39379e6..2b297fe 100644 --- a/app/views/services/email/show.html.erb +++ b/app/views/services/email/show.html.erb @@ -34,7 +34,7 @@

Your email password is different from your main account password. You can reset your email password in the - <%= link_to "email settings", setting_path(:email), class: "ks-text-link" %>. + <%= link_to "email settings", setting_path(:email) %>.

diff --git a/app/views/services/lightning/index.html.erb b/app/views/services/lightning/index.html.erb index 614f00e..a72572d 100644 --- a/app/views/services/lightning/index.html.erb +++ b/app/views/services/lightning/index.html.erb @@ -9,7 +9,7 @@

Lightning Address

Your user address is also a - Lightning Address! + Lightning Address! The easiest way to receive sats is by just giving out your address:

@@ -34,7 +34,7 @@

You can connect various wallet apps to your account. This allows you to both receive and send sats. Any wallet that supports - LNDHub + LNDHub accounts should be able to add/import your account using our setup code/URL:

@@ -57,7 +57,7 @@

- <%= image_tag("/img/logos/alby.svg", class: 'h-16') %> @@ -70,7 +70,7 @@ URL in the "LNDHub Export URI" field.

- <%= image_tag("/img/logos/bluewallet.svg", class: 'h-16') %> @@ -83,7 +83,7 @@ then scan the setup QR code.

- <%= image_tag("/img/logos/zeus.svg", class: 'h-16') %> diff --git a/app/views/services/mastodon/show.html.erb b/app/views/services/mastodon/show.html.erb index b8c7cd3..cefa1d7 100644 --- a/app/views/services/mastodon/show.html.erb +++ b/app/views/services/mastodon/show.html.erb @@ -37,7 +37,7 @@

Use your Mastodon account with many different apps, and on any devices you wish! When adding your account to an app, you will log in via - kosmos.social. + kosmos.social.

diff --git a/app/views/services/remotestorage/show.html.erb b/app/views/services/remotestorage/show.html.erb index e4146e9..fbd7ac2 100644 --- a/app/views/services/remotestorage/show.html.erb +++ b/app/views/services/remotestorage/show.html.erb @@ -46,8 +46,8 @@

If you want your favorite apps to support syncing data with your own Storage account, let the developers know! All relevant information is - available on the remoteStorage website. + available on the + remoteStorage website.