Skip to content

DeAnnoy AP news [papo] by papo

Details

Authorpapo

LicenseCC BY-NC-SA 4.0

Categoryapnews

Created

Updated

Size2.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 AP news [papo]
@namespace      github.com/paponius/userstyles
@version        1.2.0
@description    Updated: 2024-12. Notes and feedback: https://github.com/paponius/userstyles/ 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

@var checkbox UnstickHeader          "Unstick the header" 1
@var checkbox blockPopupMenus        "Block drop-down menus opened on mouse hover, covering over page content." 0
@var checkbox FooterCondense         'Condense the footer' 1
@var checkbox HideExternalRecycle    'Hide 3rd party visitor Recycle elements with ADs (Taboola: below article and right-bottom overlay window)' 0
@var checkbox HideAccessibilityButton 'Hide accessibility button' 0


==/UserStyle== */
/* tpl: 1.2.1 24-11 */
@-moz-document domain("apnews.com") {


/* hide the section if it has no ADs. 2x taboola, 1x AD */
.Page-below:not(:has(> * > *)) {
	display: none;
}

/* hide first taboola with its padding, if it's empty */
#taboola-mid-article-reco-reel-slider:not(:has(*)) {
	display: none;
}


& when (@UnstickHeader = 1) {
	/* position: static, needed to offset when AD is visible (relative would leave a gap) */
	.Page-header-stickyWrap {
/* 		can't be absolute */
/* 		position: relative; */
		position: static;
		/* --was-position: sticky; */
	}
/* 	the above has `z-index: 26;`, but will `position: static;` it will not work and the header is non-clickable,
    Setting `z-index: 26;` to its child will help */
	.Page-header-bar {
		z-index: 26;
	}
}


& when (@blockPopupMenus = 1) {
	.MainNavigationItem[data-item-hover] .MainNavigationItem-dropdown
/* 	, .SectionNavigationItem[data-item-hover] .SectionNavigationItem-dropdown */
	{
		display: none;
		/* --was-display:block */
	}
}



& when (@FooterCondense = 1) {
	@media only screen and (min-width: 1280px) {
	  .Page-footer-columns > div:first-child {
		flex: 1;
		margin-right: 0;
		/* --was-margin-right: 60px; */
		max-width: unset;
		/* --was-max-width: 320px; */
		
/* 		flex: 100%; */
		width: 100%;
	  }
	}

	.Page-footer-bottom {
		margin-top: 5px;
		padding-top: 0;
		/* --was-padding-top: 20px; */
	}

	.FooterNavigationItem a, .FooterNavigationItem span {
		margin-bottom: 0;
		/* --was-margin-bottom: 20px; */
	}
	
	.Page-footer {
		padding-top: 10px;
		/* --was-padding-top: 60px; */
		padding-bottom: 0;
		/* --was-padding-bottom: 30px; */
	}
}



& when (@HideAccessibilityButton = 1) {
	#usntA40Toggle {
		display: none !important;
	}
}



& when (@HideExternalRecycle = 1) {
/* 	[data-testid="outbrain"] {
		display: none;
		--p-switched-off-in-stylus-options: 1;
	} */
	
	.TaboolaRecommendationModule {
		display: none;
		--p-switched-off-in-stylus-options: 1;
	}
}


}

Reviews

No reviews yet.