Skip to content

An userscript to load TangerineUI's redesign by @nileane 🍊🐘 on whichever instance you'd like !

Notifications You must be signed in to change notification settings

Write/TangerineUI-Userscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 

Repository files navigation

TangerineUI-Userscript

An userscript to load TangerineUI Redesign for Mastodon's Web UI by @nileane 🍊🐘 on whichever instance you'd like !

Usage and Installation

Installing an userscript manager

Chrome / Firefox

Safari (iOS / macOS)

Installing the userscript

  • Once the userscript manager is installed, click on this link, your userscript manager should offer you to install the script.
  • After the userscript is installed, edit the userscript to add a @include (at the top of the file) rule for each mastodon instances you want the theme to be enabled on. Respect the same format that is given for mamot.fr and mastodon.social.
  • You can change easily switch between the normal and purple variant by changing colorScheme var.
  • You can set the tag you want to use for instance below 4.3.0 and above (or equal) 4.3.0 in tag_below_4_3_0 and tag_above_or_equals_4_3_0 vars. To find tag, look at the left sidebar in the releases of TangerineUI : https://github.com/nileane/TangerineUI-for-Mastodon/releases and change it accordingly.

Changelog

Release 2.1.0

  • Add support for the new Cherry color scheme, only supported for versions above 4.3.0
  • Since older (<= 4.3.0) instances can't have the Cherry color scheme, I had to create a new variable, hence why there's now legacyColorScheme and newColorScheme var, so you can choose which color scheme to use for the "legacy" and "new" mastodon version.

Release 2.0.0

Untitled

  • ✨ Support Mastodon >= 4.3.0 ✨
  • Dynamically loads the right CSS based on your instance version
  • Loaded CSS is now minified thanks to jsdelivr

Release 1.3.0

  • ✨ Full support for Mastodon >= 4.1.6 ✨
  • Mastodon's enhanced their CSP restriction which made the userscript not working on instance above or equals >= 4.1.6
  • I was kinda scared I couldn't find a workaround that, but thankfully mastodon expose a meta header of the name "style-nonce", that you can fetch and use to inject the styling url with. This, of course, add a penalty delay before theme's injection. I'd hapilly takes PR if you find a way around that.

Release 1.2.5

  • Disable the script on page not stylized by TangerineUI anyway

Release 1.2.4

  • Forcefully disconnect MutationObserver after 3 seconds if MutationObserver wasn't disconnect already This fix a performance issue where MutationObserver would be running indefinitely if it never detected the element
  • Apply background && background-color to <body> tag yet again
  • Add a configurable timeout after how much time the css applied <html> and <body> should be reverted, default to 1 second

Release 1.2.3

  • Now apply background color pre-emptively on either light or dark mode This fix a flashing issue on load, if the instance main's theme was set as dark mode, but the system was in light mode
  • The pre-emptively color set to <html> is now dynamic, based selected theme (for light mode only, as dark mode as same color for both variants)
  • Correctly set background color in dark mode to TangerineUI Color instead of pure black

Release 1.2.0

  • "Production ready" code
  • <html> tag now injected instantly, as it doesn't require to wait for it.
  • Moved from requestAnimationFrame to MutationObserver which should inject theme even faster.
  • Hugely improved code's readability
  • Compatible with both Firefox and Chrome
  • Support Safari, even though injection is slow, limited to requestAnimationFrame API as MutationObserver doesn't work most of the time (except when cache is cleared with CMD + SHIFT + R), certainly a limitation from how Safari handle extensions. Safari extension is : https://apps.apple.com/us/app/userscripts/id1463298887 -- Mac & iOS support. It support UserStyles too, so you could just create one instead.

About

An userscript to load TangerineUI's redesign by @nileane 🍊🐘 on whichever instance you'd like !

Resources

Stars

Watchers

Forks

Packages

No packages published