DeckThemes / SDH-CssLoader

Loads CSS dynamically into the steam deck game ui
GNU General Public License v3.0
114 stars 9 forks source link

Add custom string and image URL patches #18

Closed joamjoamjoam closed 2 years ago

joamjoamjoam commented 2 years ago

Story Voice Use Case: As a theme user I want to configure complex values like Strings, colors, image URLs, etc. through the Plugin UI and have the theme uses these values.

Is it possible implement a system to pass values configured in the UI into the CSS scripts so that they can be used in a theme?

Even something as simple as replacing with the value entered in the UI would allow for some greater flexibility for the average theme user. It would also prevent developers from having to make a bunch of CSS files for colors and stuff.

EMERALD0874 commented 2 years ago

Assigning this to smms as they're the one who primarily deals with the Python backend.

suchmememanyskill commented 2 years ago

I don't think it's be a great user experience if i take a literal value from the frontend and interpolate it into a .css file, besides the millions of other things that could go wrong with that

The only thing i'd accept is some color picker in the front end, but as such a menu has to be custom made, i don't think it should be implemented any time soon

As for interpolating raw text: no, i will never make this a thing

EMERALD0874 commented 2 years ago

To add to what smms said, I feel like there isn't a good argument being made for the feature here.

joamjoamjoam commented 2 years ago

I think anyone should be able to customize a theme in ways that the developer intends. For example set a background image option and anyone can paste in the url for an image.

Not everyone can modify a css file. Also are you going to accept themes that are just a copy paste with a different image URL?

I agree with the raw text issue it was just a suggestion to get this functionality quick. A color picker with opacity and a file selector or ability to specify an image file in some way is something that should be considered a need so that the average person can start to theme their deck. Having to create a file per variable per color gets unweildly fast.

In short what im asking for is a way for a user to provide via patch:

EMERALD0874 commented 2 years ago

Not everyone can modify a css file.

Not everyone can easily type out an entire image URL in game mode, either. It would be arguably easier for a developer to say how to edit the image in the description, have the user go to desktop mode, and have them copy/paste the image URL of their choice directly into the CSS file.

Also are you going to accept themes that are just a copy paste with a different image URL?

That's actually something we're still debating. There are multiple themes that are arguably just wallpaper themes. However, I did discuss how this could become irritating to browse with the other collaborators.

joamjoamjoam commented 2 years ago

Some (i would say a very large percentage) people are scared to even enter desktop mode at all. I understand that that may not be your target audience but if we can make it a bit more accessible it would benefit everyone.

You can cut down on a large amount of spam themes by implementing the color picker alone. Even as a developer its not ideal to have to add a bunch of css files that just set a root variable. Combine it with a well written theme that exposes all the themeable elements of the Deck UI and you cover a large amount of the low value themes people might want. For most people just changing the colors and wallpapers are enough.

Then you can focus on adding the cool stuff (like phantom BTW!) and have an easy reason to reject any Color/Wallpaper reskins in the future.

The Gawr Gura theme I wrote is intended to be that "well written theme" and i plan to go back remove the images bundled themes to make it basically a color reskin.

I think the color picker/file selector, recolor theme, and the local hosting (to get around any performance issues if someone decides to go ham) issue #20 would provide a way to let anyone customize their theme. More importantly it should cut down the number of pull requests you guys have to look at.

I think there's two questions here.

  1. Would you accept themes (to lean into the enable what you want philosphpy) like:

    • Theme Main Wallpaper with image selection via dropdown patch and people add images via css
    • Theme Library Wallpaper
    • Theme Lock Screen Wallpaper
    • Set All Colors Theme
  2. Do we need a color picker and wallpaper picker patch or is that something that maybe a "Steam Deck Theme Creator" External app should do and then you just load the theme in to CSS Loader? The former way takes more effort but eliminates theme reskin issue and cuts down on future PR submissions.

All that said whatever the decision is I plan to contribute to the implementation (if needed/wanted). Im not the guy to bring up issues without solutions lol. If you would accept the above themes maybe ill start there.

joamjoamjoam commented 2 years ago

At the end of the day the Image Picker class could be as simple as adding a themes/userImages folder and the image patch would just pull the images using the python backend maybe even cached on reload. And the locally hosted URL would be passed into the CSS on injection either by direct replacement or via a :root variable.

EMERALD0874 commented 2 years ago

I have discussed this with the other contributors and here is what we have decided:

Regarding images and custom strings, we have decided not to allow them. They do not seem to serve much of a purpose as images can be replaced by the user going through the CSS file and custom strings could easily create more harm and confusion than good. Theme creators and editors should be expected to have enough knowledge to edit a CSS file using a basic text editor if they want to edit a complex key component of a theme. Users should also be expected to be comfortable using desktop mode as they already have to do so to install Decky.

Regarding colors, we are moving this issue to #21. This feature will hopefully be implemented in the future. This issue is being separated into a discussion of custom strings and images.