Unable to set theming #84

Open
opened 2020-07-17 08:45:18 +00:00 by loke · 6 comments
Member

It is not possible to switch Mastodon FE to light theme.

Steps to reproduce:

  1. Select Mastodon FE
  2. Click on the settings button
  3. Click on User Preferences

This sends you back to the Pleroma FE preferences screen so there is no way to set the theme for Mastodon FE. This is a problem for people like myself whose bad astigmatism makes it impossible to use UI's with dark backgrounds.

It is not possible to switch Mastodon FE to light theme. Steps to reproduce: 1. Select Mastodon FE 2. Click on the settings button 3. Click on User Preferences This sends you back to the Pleroma FE preferences screen so there is no way to set the theme for Mastodon FE. This is a problem for people like myself whose bad astigmatism makes it impossible to use UI's with dark backgrounds.
Owner

Yes, this feature is unsupported right now, in Mastodon this is into the backend settings.

Yes, this feature is unsupported right now, in Mastodon this is into the backend settings.
Author
Member

Thank you you for the information. Is there a way to force a specific theme, perhaps from the server side?

Also, is there a plan to support this at some point?

Thank you you for the information. Is there a way to force a specific theme, perhaps from the server side? Also, is there a plan to support this at some point?
Owner

There is a way but it's via patching the backend, not exactly something great.

contrast theme:

diff --git a/lib/pleroma/web/templates/masto_fe/index.html.eex b/lib/pleroma/web/templates/masto_fe/index.html.eex
index c330960fa..50da651b0 100644
--- a/lib/pleroma/web/templates/masto_fe/index.html.eex
+++ b/lib/pleroma/web/templates/masto_fe/index.html.eex
@@ -25,10 +25,11 @@

 <script src="/packs/flavours/glitch/common.js"></script>
 <link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" />
+<link rel="stylesheet" media="all" href="/packs/skins/glitch/contrast/common.css" />

 <script src="/packs/flavours/glitch/home.js"></script>
 </head>
-<body class='app-body no-reduce-motion system-font'>
+<body class='app-body no-reduce-motion system-font skin-constrast'>
   <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'>
   </div>
 </body>

light theme:

diff --git a/lib/pleroma/web/templates/masto_fe/index.html.eex b/lib/pleroma/web/templates/masto_fe/index.html.eex
index c330960fa..5c8217162 100644
--- a/lib/pleroma/web/templates/masto_fe/index.html.eex
+++ b/lib/pleroma/web/templates/masto_fe/index.html.eex
@@ -25,10 +25,11 @@

 <script src="/packs/flavours/glitch/common.js"></script>
 <link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" />
+<link rel="stylesheet" media="all" href="/packs/skins/glitch/mastodon-light/common.css" />

 <script src="/packs/flavours/glitch/home.js"></script>
 </head>
-<body class='app-body no-reduce-motion system-font'>
+<body class='app-body no-reduce-motion system-font skin-mastodon-light'>
   <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'>
   </div>
 </body>
There is a way but it's via patching the backend, not exactly something great. contrast theme: ```diff diff --git a/lib/pleroma/web/templates/masto_fe/index.html.eex b/lib/pleroma/web/templates/masto_fe/index.html.eex index c330960fa..50da651b0 100644 --- a/lib/pleroma/web/templates/masto_fe/index.html.eex +++ b/lib/pleroma/web/templates/masto_fe/index.html.eex @@ -25,10 +25,11 @@ <script src="/packs/flavours/glitch/common.js"></script> <link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" /> +<link rel="stylesheet" media="all" href="/packs/skins/glitch/contrast/common.css" /> <script src="/packs/flavours/glitch/home.js"></script> </head> -<body class='app-body no-reduce-motion system-font'> +<body class='app-body no-reduce-motion system-font skin-constrast'> <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'> </div> </body> ``` light theme: ```diff diff --git a/lib/pleroma/web/templates/masto_fe/index.html.eex b/lib/pleroma/web/templates/masto_fe/index.html.eex index c330960fa..5c8217162 100644 --- a/lib/pleroma/web/templates/masto_fe/index.html.eex +++ b/lib/pleroma/web/templates/masto_fe/index.html.eex @@ -25,10 +25,11 @@ <script src="/packs/flavours/glitch/common.js"></script> <link rel="stylesheet" media="all" href="/packs/flavours/glitch/common.css" /> +<link rel="stylesheet" media="all" href="/packs/skins/glitch/mastodon-light/common.css" /> <script src="/packs/flavours/glitch/home.js"></script> </head> -<body class='app-body no-reduce-motion system-font'> +<body class='app-body no-reduce-motion system-font skin-mastodon-light'> <div class='app-holder' data-props='{&quot;locale&quot;:&quot;en&quot;}' id='mastodon'> </div> </body> ```
Owner

And for the support side of things, I'll give it a shot at having the settings in MastoFE but no promises there as I'm not a React frontend developer at all.

And for the support side of things, I'll give it a shot at having the settings in MastoFE but no promises there as I'm not a React frontend developer at all.
Author
Member

Thank you very much for the update. It was very enlightening.

Thank you very much for the update. It was very enlightening.
Member

If you want a temporary solution I made this userscript https://github.com/Cesese/UserScripts-cesese/blob/master/mastofe-light-theme.js

you can use it with tampermonkey and other such browser extensions, you just need to change the instance name to yours in the 6th line

I didn't know about the contrast theme and about the .eex file and body class, so it just changes the css, but I didn't see anything that looked weird.

To change it to contrast theme, you just need to replace /packs/skins/glitch/mastodon-light/common.css by /packs/skins/glitch/contrast/common.css in the 20th line.

If you want a temporary solution I made this userscript https://github.com/Cesese/UserScripts-cesese/blob/master/mastofe-light-theme.js you can use it with tampermonkey and other such browser extensions, you just need to change the instance name to yours in the 6th line I didn't know about the contrast theme and about the .eex file and body class, so it just changes the css, but I didn't see anything that looked weird. To change it to contrast theme, you just need to replace `/packs/skins/glitch/mastodon-light/common.css` by `/packs/skins/glitch/contrast/common.css` in the 20th line.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
3 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/mastofe#84
No description provided.