Skip to content

DeAnnoy Washington Post [papo] unstick, subscrib.. by papo

Screenshot of DeAnnoy Washington Post [papo] unstick, subscrib..

Details

Authorpapo

LicenseCC BY-NC-SA 4.0

Categorywashingtonpost

Created

Updated

Size4.9 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

See @description in the Source Code.

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name           DeAnnoy Washington Post [papo]
@namespace      github.com/paponius/userstyles
@version        1.0.7
@description    Updated: 2024-12. [m] Notes and feedback: https://github.com/paponius/userstyles/. Removed distracting and annoying elements. Check what it does in style Options, or read @var descriptions on top of the code.
@author         Papo
@homepageURL    https://github.com/paponius/userstyles/
@supportURL     https://github.com/paponius/userstyles/
@license        CC BY-NC-SA 4.0
@preprocessor   less

# --- END: common block ---


@var checkbox UnstickHeader          "Unstick the header" 1
@var checkbox UnstickHeader2         "Unstick the secondary (Live, Trending) header" 1
@var checkbox HideStickingAD         "Hide sticking AD on bottom" 1
@var checkbox HideOutbrainRecycle    'Hide 3rd party visitor Recycle elements' 1
@var checkbox HideMidArticleAnnoy    "Hide mid-article subscription, Follow and unrelated annoyance boxes" 1
@var checkbox HideMidArticleRecirc   "Hide mid-article recirculation cards" 0
@var checkbox HideNewsletter         "Hide Newsletter subscription box" 1
@var checkbox HideComments           "Hide comments" 0

==/UserStyle== */
/* tpl: 1.2.2 24-11 */
@-moz-document domain("washingtonpost.com"), url-prefix("file") {

/* todo:
https://www.washingtonpost.com/business/interactive/2024/us-sanctions-work-russian-oligarch-yacht-seized/
 */

@bUnstickHeader: boolean(@UnstickHeader = 1);
@bUnstickHeader2: boolean(@UnstickHeader2 = 1);

/* - alert header -
& when (@xxx-OptionalTODO-UnstickAlertHeader-xxx) {
	#sf-primary-nav ~ [data-link-group="alert"] {
		position: static;
		--was-position: sticky;
	  top: 0;
	}
}
 */

& when (@bUnstickHeader) {
	/* .wpds-c-fFSapB-fAfUZ-isFixed-true { */
	nav[class*="-isFixed-true"] {
		position: absolute;
		/* --was-position: fixed; */
	}
	/* sometimes the nav's parent is sicky instead */
	/* #sf-primary-nav.wpds-c-gCLoHk-fREMik-isSticky-true { */
	#sf-primary-nav[class*="-isSticky-true"] {
		position: relative;
		/* --was-position: sticky; */
	}
	
	/* - sometimes: Subscribe: :"For a limited time only, save up to 75% on a year of The Post! Switch on." */
	/* .wpds-c-cFaYiI-dguCHI-position-fixed */
	.center [class*="-position-fixed"]:first-child {
		position: absolute;
		/* --was-position: fixed; */
	}

	/* alert header move to top */
	#sf-primary-nav ~ [data-link-group="alert"] {
		top: 0;
	}

	/* move to top second header when it's still sticky */
	/* are not live and trending bar always on one bar? */
	#main-content > div:has(> ul[data-link-group="live-bar"]),
	#main-content > div:has(> ul[data-link-group="trending-bar"]) {
		top: 0;
		/* --was-top: 59px; */
	}

	/* second header, only [m] */
	#main-content > div > div:has(> [aria-label="Navigation"])[class*="-isSticky-true"] {
		position: static;
	}
}

& when (@bUnstickHeader2) {
	#main-content > div:has(> ul[data-link-group="live-bar"]),
	#main-content > div:has(> ul[data-link-group="trending-bar"]) {
		top: 0;
		position: relative;
		/* --was-position: sticky; */
	}
/* 		when this header is present on a page, it will get sticky after a scroll-down, it also hides primary header */
	#elex-subnav {
		position: relative;
		/* --was-position: sticky; */
	}
}

& when (@HideNewsletter = 1) {
	div:has(> div[data-qa="newsletter"]) {
		display: none;
	}
	div:has(> div > [data-test-id="tf-wrapper"]) {
		display: none;
	}
	
	/* on HP on [m] only */
	main#main-content div:has(> .multi-table-chain) > .hide-for-print:has(a[href^="https://subscribe.washingtonpost.com/"]) {
		display: none;
	}
}

/* AD sticking on bottom on [m] */
& when (@HideStickingAD = 1) {
	#main-content ~ .fixed.bottom-0[data-testid="wp-ad-wrapper"] {
		display: none;
	}
}

& when (@HideOutbrainRecycle = 1) {
	[data-testid="outbrain"] {
		display: none;
	}
}

/* in another userstyle: */
.article-body:has(a[data-qa="interstitial-link"], > [data-qa="subscribe-promo"], > #gift-share-inline) {
	--x-another: 1;
}

& when (@HideMidArticleAnnoy = 1) {
	#gift-share-inline,
/* "Follow" */
	div:has(> [data-test-id="tf-wrapper"])
	{
		display: none;
	}
	/* - newsletter subscription - */
	/* this is in a carousel, with one item shown at a time, sometimes the last of these is Subscribe,
	   only hide here, if the Subscribe is the first */
	.article-body > div:has([data-testid="carousel-item-0"] a[href^="https://www.washingtonpost.com/newsletters/"])
	, .article-body > div:has([data-qa="carousel-item-0"] a[href^="https://www.washingtonpost.com/newsletters/"])
	{
		display: none;
	}

}

& when (@HideMidArticleRecirc = 1) {
	.article-body:has([data-testid="inline-magnet"]),
	.article-body:has([data-qa="inline-magnet"]) {
		display: none;
	}
}

& when (@HideComments = 1) {
	[data-testid="coral-comments"],
	div:has(> [data-qa="comments-btn-div"]),
	[data-testid="article-actions-bar"] [data-testid="comments-button"]
	{
		display: none;
	}
}

}

Reviews

No reviews yet.