openstyles / stylus

Stylus - Userstyles Manager
https://add0n.com/stylus.html
GNU General Public License v3.0
5.5k stars 306 forks source link

[Bug] My style isn't being applied to discord (even when patching CSP) (Vencord is a possible culprit?) #1634

Closed Sabbkavelli closed 1 year ago

Sabbkavelli commented 1 year ago

Bug Report

Bug Description

So I have this style for discord, but it isn't applying. I tried patching CSP but it still doesn't work. One thing to note is that it works if you alter the main.css file with something inconsequential like adding and removing a space after a semicolon.

Screenshots

image

image

CSS Code

Here is my CSS Code: https://pastebin.com/iWjAy5P5

System Information

I am on Firefox and I'm using Stylus version 1.5.33.

Additional Context

As I was writing this, I uninstalled and reinstalled Vencord and it works now? That means the Vencord plugin is probably affecting Stylus. I'll still post this bug if the problems come back.

Edit #1: So I closed my browser and reopened it, the theme does not work anymore.

tophf commented 1 year ago

The styles are applied using the standard CSS mechanism, so another style with more specific selectors for individual elements in the page can override your theme which only defines the variables and doesn't individually apply them to elements. The only solution for you is to specify individual element's selector with a higher specificity than that other extension's styles, which you can see in devtools inspector.