misskey-dev / misskey

🌎 An interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.69k stars 1.3k forks source link

Add Custom CSS field option in theme creation #7143

Open Dehelssey opened 3 years ago

Dehelssey commented 3 years ago

First of all let me say that the theme creation tool is pretty awesome and covers a lot of things.

it could be a really great addition to theme creation if we were able to add custom CSS to tweak the UI a little if needed \o/

right now i'm doing those tweaks with Stylus on Firefox but there's no equivalent for mobile... :)

syuilo commented 3 years ago

In general, CSS relies heavily on the actual HTML structure, which may not be very useful for Misskey's web client, which is constantly improving and changing. CSS also makes it possible to insert malicious styles (making it impossible to manipulate anything, stealing user input, etc.).

Dehelssey commented 3 years ago

hmm good point. the custom CSS might indeed "break" if HTML structure changes on a new release... guess i'll stick to Stylus on desktop and hope that this extension comes to firefox mobile one day 😉

syuilo commented 3 years ago

However, it may be worth implementing as an option. It would be user-friendly to display something like "This theme contains custom CSS."

Dehelssey commented 3 years ago

if user can add some custom scripts (i still don't know how to use this feature^^) i'm pretty confident adding some custom CSS would be easier. Like i said, a lot of people are used to stylus extension in firefox to customize appareance of different websites.

so a little css box with a warning like "only if you know what you're doing" would be awesome :)

belatedly commented 3 years ago

I would love this option. I requested the ability to hide renotes, and I currently have a style set through Stylus on Firefox to hide them; it would be amazing to set it on my instance's level through CSS in admin settings

syuilo commented 3 years ago

I don't think that use case is actually related to the theme feature. Therefore, it seems to be a good idea to just allow custom CSS to be written in the settings, not as a theme.

belatedly commented 3 years ago

I don't think that use case is actually related to the theme feature. Therefore, it seems to be a good idea to just allow custom CSS to be written in the settings, not as a theme.

Yes that would be perfect so it would apply to the instance and thus apply on any browser, whether it is desktop and mobile. Hiding renotes is a simple css override so that would suit my needs perfectly

syuilo commented 3 years ago

Custom CSS (not as theme) has been implemented https://github.com/misskey-dev/misskey/commit/c7a2c368d41219c362c91e6a756265b33d129f44