Module:Icon/styles.css
From Shroudforge
More actions
.t-icon {
user-select: none;
}
/*
* Mask mode: render the icon as a CSS mask filled with currentColor, so it
* matches the surrounding text and recolours with it. The file URL is stashed
* in --t-icon-url inline (a quoted string); it is consumed here via image-set()
* + bare var() because the sanitizer rejects url(var()) inline. inline-block so
* the inline width/height apply (incl. inside a wrapping link).
*
* COUPLING: image-set(var()) requires TemplateStylesExtender at a revision
* BEFORE a9043c4 (custom-property external-resource ban). The wiki must
* carry that pin in sct-docker-images (composer 'dev-master' with no sha
* WILL pull the ban back on the next image rebuild and blank every mask
* icon). Safe with the pin because the wiki's enforced CSP default-src
* restricts image fetches. Upstream opt-in proposal:
* https://github.com/octfx/mediawiki-extensions-TemplateStylesExtender/issues/45
*/
.t-icon--mask {
display: inline-block;
--t-icon-mask: image-set(var(--t-icon-url) 1x);
mask-image: var(--t-icon-mask);
mask-size: contain;
mask-repeat: no-repeat;
mask-position: center;
background-color: currentColor;
vertical-align: middle;
}