SteamClientHomebrew / Millennium

Apply themes/skins/customize Steam® after the 2023-04-27 Chromium UI update
https://steambrew.app
MIT License
860 stars 14 forks source link

[Bug] CSS root is not patched correctly on webpages #69

Open SpaceEnergy opened 1 month ago

SpaceEnergy commented 1 month ago

Before Reporting

Describe the Bug

CSS root colors are displayed in the DevTools but are not recognized by CSS and are therefore greyed out

Expected Behavior

The CSS should recognize the variable and use its color

Steps To Reproduce

  1. add a variable color for the scrollbar
  2. use "RootColors": "" in skin.json
  3. open the store page or steamcommunity.com in Steam and have a look at the scrollbars

Operating System

Windows

Anything else?

image image

SpaceEnergy commented 1 month ago

oh....... nvm is my mistake XD

SpaceEnergy commented 1 month ago

but do you have another solution how to do this so that it works with the system accent colors because if i import them normally then they are always like this even if the option is off

shdwmtr commented 1 month ago

but do you have another solution how to do this so that it works with the system accent colors because if i import them normally then they are always like this even if the option is off

What do you mean "so that it works with the system accent colors"?

SpaceEnergy commented 1 month ago

hmm, I also have in the skin.json

        "System accent colors": {
            "description": "Replaces the SpaceTheme accent colors with your system accent colors",
            "default": "no",
            "values": {
                "no": {},
                "yes": {
                    "TargetCss": { "affects": [".*"], "src": "options/systemAccent.css" }
                }
            }
        },

inside and systemAccent.css only changes 2 accent variables, and if I have the option "System accent colors" on, the css file is not patched into the webpages (so the one at the top xd)

Translated with www.DeepL.com/Translator (free version)

SpaceEnergy commented 1 month ago

if you want to have a look yourself you can use the files i sent you via DM in discord

shdwmtr commented 1 month ago

So your issue is that dynamic patching doesn't inject CSS into the webpages?

SpaceEnergy commented 1 month ago

basically yes

shdwmtr commented 1 week ago

I've finally found time to address this. I'm thinking of reimplementing web-patching based off of URL regex matching like it used to, which I can't see being problematic.

Like:

"System accent colors": {
    "description": "Replaces the SpaceTheme accent colors with your system accent colors",
    "default": "no",
    "values": {
        "no": {},
        "yes": {
            // .* will affect steam store, and so will https://*.steampowered.com
            "TargetCss": { "affects": [".*", "https://*.steampowered.com"], "src": "options/systemAccent.css" }
        }
    }
}

or for static patching:

{
    "MatchRegexString": "https://*.steampowered.com",
    "TargetCss": "src/styles/loginView.css"
}

Once I look into it deeper, I'll see if this is actually doable.