@mixin scrollbarFix() {
	// This @supports selector is a temporary fix for https://github.com/microsoft/vscode/issues/213045#issuecomment-2211442905
	@supports selector(::-webkit-scrollbar) {
		html {
			scrollbar-color: unset;
		}
	}
}

@mixin scrollableBase() {
	@include scrollbarFix();

	body {
		&.scrollable,
		.scrollable {
			border-color: transparent;
			transition: border-color 1s linear;

			&:hover,
			&:focus-within {
				&.scrollable,
				.scrollable {
					border-color: var(--vscode-scrollbarSlider-background);
					transition: none;
				}
			}
		}

		&.preload {
			&.scrollable,
			.scrollable {
				transition: none;
			}
		}
	}

	::-webkit-scrollbar-corner {
		background-color: transparent !important;
	}

	::-webkit-scrollbar-thumb {
		background-color: transparent;
		border-color: inherit;
		border-right-style: inset;
		border-right-width: calc(100vw + 100vh);
		border-radius: unset !important;

		&:hover {
			border-color: var(--vscode-scrollbarSlider-hoverBackground);
		}

		&:active {
			border-color: var(--vscode-scrollbarSlider-activeBackground);
		}
	}
}
