about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-11 16:32:01 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commit57e21cf47e7c1bf0b5f1c034e756944f9d57fb39 (patch)
treedbca96256a928d880162f9322901ca3fb4091dc0 /app/controllers
parentcd5fadcd8d9df4a12e984cfc43193571dae5bdae (diff)
[UI] Move CSS for style settings to custom web app CSS controller
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/user_webapp_css_controller.rb33
1 files changed, 32 insertions, 1 deletions
diff --git a/app/controllers/user_webapp_css_controller.rb b/app/controllers/user_webapp_css_controller.rb
index fcfbf9aed..8ad9fbd2e 100644
--- a/app/controllers/user_webapp_css_controller.rb
+++ b/app/controllers/user_webapp_css_controller.rb
@@ -14,10 +14,41 @@ class UserWebappCssController < ApplicationController
 
   private
 
-  def css
+  def css_dashed_nest
+    return unless @account.user&.setting_style_dashed_nest
+
+    %(
+      div[data-nest-level]
+      { border-style: dashed; }
+    )
+  end
+
+  def css_underline_a
+    return unless @account.user&.setting_style_underline_a
+
+    %(
+      .status__content__text a,
+      .reply-indicator__content a,
+      .composer--reply > .content a,
+      .account__header__content a
+      { text-decoration: underline; }
+
+      .status__content__text a:hover,
+      .reply-indicator__content a:hover,
+      .composer--reply > .content a:hover,
+      .account__header__content a:hover
+      { text-decoration: none; }
+    )
+  end
+
+  def css_webapp
     @account.user&.setting_style_css_webapp_errors.blank? ? (@account.user&.setting_style_css_webapp || '') : ''
   end
 
+  def css
+    "#{css_dashed_nest}\n#{css_underline_a}\n#{css_webapp}".squish
+  end
+
   def set_account
     @account = Account.find(params[:id])
   end