An icon as an <svg> element, built with the DOM (no markup string, so no Trusted Types sink), from its path: iconSvg(iconSearch), or a social mark iconSvg(markX.d, markX). It is hidden from assistive technology unless it is given a label, which names it as an image.
Parts and data attributes
Class
Is
.cap-icon
the root
.cap-icon-flip
a part
Attribute
Values
data-fill
present or absent
data-flip
present or absent
Accessibility
An icon beside words or inside a named button is decoration (aria-hidden="true"); one that stands alone and says something gets label, which makes it role="img".
It takes the text's size and color (currentColor), so it follows its button or link through hover, focus, disabled and forced colors.
Right to left: data-flip mirrors an icon that points (arrows, chevrons).