Favicon Component

npm version

About

A template to specify favicons for your site:

{% raw %}
{% render '@vf-favicon', {
    apple_touch_icon: "../../assets/vf-favicon/assets/apple-touch-icon.png",
    icon_32: "../../assets/vf-favicon/assets/favicon-32x32.png",
    icon_16: "../../assets/vf-favicon/assets/favicon-16x16.png",
    manifest: "../../assets/vf-favicon/assets/site.webmanifest",
    icon_mask: "../../assets/vf-favicon/assets/safari-pinned-tab.svg",
    color_mask: "#ffffff",
    color_msapplication: "#ffffff",
    color_theme: "#ffffff"
} %}
{% endraw %}

Yields:

{% render '@vf-favicon', {
    apple_touch_icon: "../../assets/vf-favicon/assets/apple-touch-icon.png",
    icon_32: "../../assets/vf-favicon/assets/favicon-32x32.png",
    icon_16: "../../assets/vf-favicon/assets/favicon-16x16.png",
    manifest: "../../assets/vf-favicon/assets/site.webmanifest",
    icon_mask: "../../assets/vf-favicon/assets/safari-pinned-tab.svg",
    color_mask: "#ffffff",
    color_msapplication: "#ffffff",
    color_theme: "#ffffff"
} %}

Install

This component is distributed with npm. After installing npm, you can install the vf-favicon with this command.

$ yarn add --dev @visual-framework/vf-favicon

Make sure you import Sass requirements along with the modules.


File system location: components/vf-favicon

Variants


Variant: Default live element

Nunjucks demo

{% render '@vf-favicon--default', {
  "component-type": "element",
  "apple_touch_icon": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/apple-touch-icon.png",
  "icon_favicon": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon.ico",
  "icon_32": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon-32x32.png",
  "icon_16": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon-16x16.png",
  "manifest": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/site.webmanifest",
  "icon_mask": "https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/safari-pinned-tab.svg",
  "color_mask": "#ffffff",
  "color_msapplication": "#ffffff",
  "color_theme": "#ffffff"
} %}
        

Sample output

Sample output as HTML

<link rel="shortcut icon" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/favicon-16x16.png">
<link rel="manifest" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/site.webmanifest">
<link rel="mask-icon" href="https://dev.assets.emblstatic.net/vf/develop/assets/vf-favicon/assets/safari-pinned-tab.svg" color="#ffffff">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="theme-color" content="#ffffff">
        

Assets

All components in this design system

This page is part of the components section.