Skip to content

Wiki Fixed ToC by pluff

Details

Authorpluff

LicenseNo License

Categorywikipedia

Created

Updated

Size1.4 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Keeps the Toc in reach.

Notes

I'm no coder or know much about CSS as i just started with it because Youtubes layout wasted so much space, so this might be sub-par. Like, I wanted to inherit the background(color), but it goes transparent for whatever reason.

update: moved it from the sidebar since it conflicts with it and i cannot fix it otherwise. This works too, imo
update 2. moved to the right side because it disappears some time under other elements. Not as convenient, but better than nothing, i suppose. If anyone has ideas how to fix it, please add to it.
PS: removed background as it i realised it might interfere with certain websites.

Source code

/* ==UserStyle==
@name           wikipedia.org fixed ToC
@namespace   Pluff
@version        1.0.3.1
@description    Keeps the ToC accessible
@author         Pluff
@preprocessor stylus
@var color toc-bco "border color" "darkorange"
@var range  toc-bw "Border width" [15, 1, 50, 1, "px"]

==/UserStyle== */
@-moz-document domain("wikipedia.org"),
regexp("https?:\\/\\/.*wik(i|t).*") {
	.toc {
		display: inline-block !important;
		position: fixed !important;
		z-index: 9999999 !important;
		padding: 5px 0;
		top: 0px !important;
		right: 0em !important;
		max-width: 0px!important;
		max-height: 95vh !important;
		border-width: 0 toc-bw 0 0 !important;
		border-style: solid !important;
		border-color: toc-bco !important;
		border-radius: 3px !important;
		overflow-x: hidden !important;
		white-space: nowrap !important;
		text-overflow: hidden !important;
		transition-delay: .1s !important;
		transition-duration: .4s !important;
		box-shadow: 2px 2px 1em #00000080 !important;
	}

	.toc:hover {
		transition-delay: .1s !important;
		max-width: 130em !important;
	}

	div#content.toc {
		z-index: 999999999 !important;
	}

	.tocnumber {
		padding-left: 0;
		padding-right: 0.5em;
	}

	.mw-body h1,
	.mw-body-content h1,
	.mw-body-content h2 {
		font-family: inherit;
	}

	.toc .toctitle {
		text-align: left !important;
	}

	.toc ul {
		list-style: disc;
	}
}

Reviews

No reviews yet.