Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

color: a suggested mask-icon tint

A narrowly scoped link attribute, not the CSS text-color property.

Version: HTML Living Standard

Syntax

<link rel="mask-icon" href="/icon.svg" color="#006699">

The color attribute described here belongs on a link whose relation includes mask-icon. It supplies a CSS color suggestion for the site icon shown by a supporting browser, for example when a site is pinned. It must not be placed on unrelated link types. The standard registers this extension but imposes no user-agent requirements to support it.

This is distinct from CSS text color, a color input and obsolete presentational attributes on older elements. The suggested tint does not recolor the document. There is no required reflecting DOM property for this attribute. Check link-relation support and keep an ordinary icon strategy; a valid declaration alone does not prove that a browser displays a tinted pinned icon.

In Chromium 145 the fixture reports no support for the mask-icon relation. The ordinary paragraph remains black, while an explicit CSS rule makes another paragraph blue. That result demonstrates the separate styling mechanism and honestly records unsupported icon behavior; it does not simulate a pinned-tab interface or promise the same result in every engine.

Examples

<!doctype html><meta charset="utf-8">
<link id="icon" rel="mask-icon" href="/icon.svg" color="#006699">
<p id="plain" style="color: black">Ordinary text</p><p id="styled" style="color: blue">CSS-styled text</p>
<output id="result"></output><script>
document.querySelector('#result').textContent = 'mask-icon-supported=' + document.querySelector('#icon').relList.supports('mask-icon') + '; textColor=' + getComputedStyle(document.querySelector('#plain')).color + '; styledColor=' + getComputedStyle(document.querySelector('#styled')).color;
</script>

Result

mask-icon-supported=false; textColor=rgb(0, 0, 0); styledColor=rgb(0, 0, 255)

The local SVG is available if requested. The verified browser does not support the mask-icon relation.

Sources