@import 'mediawiki.skin.variables.less';

.darkmode( @prop, @value ) {
	@media screen {
		html.skin-theme-clientpref-night & {
			@{prop}: @value;
		}
	}

	@media screen and ( prefers-color-scheme: dark ) {
		html.skin-theme-clientpref-os & {
			@{prop}: @value;
		}
	}
}

// NOTE: Only for use of icons in the WikiEditor toolbar.
.embed-img( @image ) {
	background-color: @color-base-fixed;
	/* @embed */
	@url: url( 'images/codemirror.wikieditor.@{image}.svg' );
	-webkit-mask-image: @url;
	mask-image: @url;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;

	.oo-ui-toggleWidget-on & {
		background-color: @color-progressive;
	}
}
