Skip to main content
added 277 characters in body
Source Link
Glorfindel Mod
  • 255.6k
  • 61
  • 638
  • 1.3k

You don't want a complete list here, because of code simplicity and because sites may get new / updated themes. Instead, I would indeed just call

getComputedStyle(document.body).getPropertyValue('--theme-primary-color');

to get the theme's primary color, which is (as far as I checked) the color of the vote buttons when selected.

I'm not an employee, but I'll bet a truckload of money that a site gets a new theme before that variable disappears. If it does, your script could just fallback to the stock/beta theme color ...

You don't want a complete list here, because of code simplicity and because sites may get new / updated themes. Instead, call

getComputedStyle(document.body).getPropertyValue('--theme-primary-color');

to get the theme's primary color, which is (as far as I checked) the color of the vote buttons when selected.

You don't want a complete list here, because of code simplicity and because sites may get new / updated themes. Instead, I would indeed just call

getComputedStyle(document.body).getPropertyValue('--theme-primary-color');

to get the theme's primary color, which is (as far as I checked) the color of the vote buttons when selected.

I'm not an employee, but I'll bet a truckload of money that a site gets a new theme before that variable disappears. If it does, your script could just fallback to the stock/beta theme color ...

Source Link
Glorfindel Mod
  • 255.6k
  • 61
  • 638
  • 1.3k

You don't want a complete list here, because of code simplicity and because sites may get new / updated themes. Instead, call

getComputedStyle(document.body).getPropertyValue('--theme-primary-color');

to get the theme's primary color, which is (as far as I checked) the color of the vote buttons when selected.