MediaWiki:Common.css/src/template/sound.scss

From Terraria Wiki
Jump to navigation Jump to search
/********* [[Template:Sound]] *********/

/* All of these styles should only be applied if JavaScript is enabled (because
 * the functionality doesn't work otherwise); see also
 * https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#.client-js_and_.client-nojs */

.client-js .sound {
	cursor: pointer;

	audio {
		/* hide the default HTML audio player */
		display: none;
	}

	&.iconlast .sound-title::after,
	&.iconfirst .sound-title::before {
		/* speaker icon */
		content: '';
		display: inline-block;
		width: 1.143em;
		height: 1.143em;
		vertical-align: text-top;
		background: url(https://commons.wiki.gg/images/3/36/Audio.svg);
		background-size: contain;
		filter: var(--ooui--icon-normal-filter);
	}

	.sound-title {
		&::after {
			/* for sound.iconlast */
			margin-left: 2px;
		}
		&::before {
			/* for sound.iconfirst */
			margin-right: 2px;
		}
	}

	&.sound-playing .sound-title {
		&::after,
		&::before {
			/* color the speaker icon in the "progressive" color */
			filter: var(--ooui--icon-progressive-filter);
		}
	}
}