New Tweak: Respect user's theme when in blog-view. #880
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This tweak is great for users with dark color pallets that wish to not have blinding light when viewing other user's blogs with lighter themes.
I got the idea from this Suggestion Box comment here on how they'd like to still see the theme while keeping posts readable.
This allows for more comfortable post viewing while still seeing the splash of flair from
Note: this is only for the posts themselves. The surrounding theme of the blog is preserved.
Additional note: this respects all the color pallets (True Blue, Goth Rave, Cybernetic, etc.)
Inquiry
Since this doesn't truly affect the dashboard, simply the blog-view, is it appropriate to be included in Tweaks? Tweaks is defined to the users as "Miscellaneous dashboard options".
Would it be more appropriate for this to be a stand-alone script?
Note: this is not the same behavior as Themed Posts, as this is the user's pallet and not the target blog's theme.
Note: this is not the same behavior as disabling "Use blog colors when viewing blogs" as mentioned here. It preserves the surrounding theme.
Technical Explanation
All this does is prevent the CSS variables of the blog from overriding the user's color pallet on posts by setting the color variables to
inherit !important;
and appends the style to the document head.Testing steps
Just enable "Respect the user's theme on blog pages" under Tweaks!
It should only change the theme of posts in blog-view.