Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom css feature for the WebUi #13415

Closed
wants to merge 1 commit into from

Conversation

n-peugnet
Copy link

@n-peugnet n-peugnet commented Sep 20, 2020

I came across this qBitTorrent WebUi theme but didn't really like the proposed way to install it. So instead I added a "Custom Css" feature for the WebUi.

Custom css can now be added to the WebUi using 2 new options in the preferences.
It is based on the "translation" feature already present in the WebUi. I am not sure if this is the best way to obtain this result but it probably is the easiest.

Custom css can now be added to the webui using 2 new options in the
preferences.
It is based on the translate feature already present in the WebUi.
@FranciscoPombal FranciscoPombal added Core WebUI WebUI-related issues/changes labels Sep 20, 2020
@FranciscoPombal
Copy link
Member

ping @jagannatharjun @Piccirello

@Piccirello
Copy link
Member

Hmm, this is an interesting feature. I suspect some team members will be opposed to introducing such functionality into a BitTorrent client. Can you point to any existing requests for a feature like this? Also can you post screenshots of this feature in the Web UI and GUI?

@n-peugnet
Copy link
Author

n-peugnet commented Sep 21, 2020

Here are the screenshot of the updated parts of the UI:

GUI

image

WebUi

image

I suspect some team members will be opposed to introducing such functionality into a BitTorrent client.

The main idea was to be able to set a dark theme for the WebUi. As I found an already existing dark theme, I thought that the easiest way to have the WebUi in dark was to add a custom css feature.
Maybe a more restrictive theme chooser between the current white theme and a new dark theme could be more suitable ?

Can you point to any existing requests for a feature like this?

I searched for this but didn't find any though it's related to the dark theme discussions like #6434

@WolfganP
Copy link

My concern is that now you have 2 points for modifying the same WebUI look and feel, and maybe introducing override conflicts.
What will be different from introducing the CSS changes via this config rather than modifying the .css file/s of the alt WebUI in use and just reload the page?

@glassez
Copy link
Member

glassez commented Sep 23, 2020

If you need a custom WebUI, just use "Alternative WebUI" feature, it is provided for all such purposes.

@zero77
Copy link

zero77 commented Oct 5, 2020

@glassez

If you need a custom WebUI, just use "Alternative WebUI" feature, it is provided for all such purposes.

If you like the default web ui, but want a different theme, that's possible but would require the ability to use custom css.

https://github.com/gilbN/theme.park

image

@WolfganP
Copy link

WolfganP commented Oct 5, 2020

@glassez

If you need a custom WebUI, just use "Alternative WebUI" feature, it is provided for all such purposes.

If you like the default web ui, but want a different theme, that's possible but would require the ability to use custom css.

https://github.com/gilbN/theme.park

Just copy the webUI files and alter the .css to your liking, then use them via the AltWebUI mechanism.

@n-peugnet
Copy link
Author

Just copy the webUI files and alter the .css to your liking, then use them via the AltWebUI mechanism.

In my opinion, the problem with this approach is that you will have to manually update the WebUi and re-edit the files after each qBittorrent update to get the latest WebUi update. When with this solution the WebUi would still be updated as usual. Also this allows to change the theme without any kind of file access to the server.

I understand that the custom CSS could be a little bit overkill. But what would you think about a "dark theme" setting that could be used by any WebUi to switch between their own light and dark themes ?

@WolfganP
Copy link

WolfganP commented Oct 5, 2020

I understand that the custom CSS could be a little bit overkill. But what would you think about a "dark theme" setting that could be used by any WebUi to switch between their own light and dark themes ?

That's exactly the problem, it won't apply to any WebUI, just the default and if this core WebUI changes, conflicts of precedence may arise. The other altWebUIs also need to follow the naming of this custom .css field and if not, it may also lead to unexpected results.

Visual problems attract a lot of project issues and are difficult to handle properly due to volume, so having 2 places affecting the visual style is a call for extra project maintenance work for the devs.

@n-peugnet
Copy link
Author

n-peugnet commented Oct 5, 2020

I understand that the custom CSS could be a little bit overkill. But what would you think about a "dark theme" setting that could be used by any WebUi to switch between their own light and dark themes ?

That's exactly the problem, it won't apply to any WebUI, just the default and if this core WebUI changes, conflicts of precedence may arise. The other altWebUIs also need to follow the naming of this custom .css field and if not, it may also lead to unexpected results.

So here you are talking about the custom CSS feature of this PR, right ? To be compatible, an alternative WebUi would just have to add the <style>%CUSTOMCSS%</style> line in the two index.html files. This does not seem too complicated to me. Also they do not have to necessarily follow the same naming. The CSS can be customised to fit any WebUi.

Visual problems attract a lot of project issues and are difficult to handle properly due to volume, so having 2 places affecting the visual style is a call for extra project maintenance work for the devs.

The custom CSS is not meant to be maintained by the qBittorrent team it's a per user feature that each user is free to customise as he wants. If the result creates visual problems it's the user's problem and he will have to edit it's CSS himself.

@glassez
Copy link
Member

glassez commented Oct 6, 2020

Why don't you just use a suitable extension for your browser that allows you to redefine CSS for any site, not just for qBittorrent Web UI?

@github-actions
Copy link

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@github-actions github-actions bot added the Stale label Aug 12, 2021
@github-actions
Copy link

This PR was closed because it has been stalled for some time with no activity.

@github-actions github-actions bot closed this Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Stale WebUI WebUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants