A simple component to add the Visual Framework logo to a page. You'll likely want to use this one as a template to add your own logo.
Depending on your environment you'll want to use render
or include
. As a rule of thumb: server-side use include
, precompiled browser use render
. If you're using vf-eleventy you should use include
.
include
You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include
is an abstraction of render
and provides some additional portability.
{% set context fromYourYamlFile %}
- or -
{% set context = {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"hidden_text" : false,
}
%}
{% include "../path_to/vf-logo/vf-logo.njk" %}
render
This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include
is not be available.
{% render '@vf-logo', {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"hidden_text" : false,}
%}
<a href="https://stable.visual-framework.dev/" class="vf-logo | vf-logo--has-text">
<img class="vf-logo__image" src="https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg" alt="Visual Framework" loading="eager">
<span class="vf-logo__text">Visual Framework</span>
</a>
Depending on your environment you'll want to use render
or include
. As a rule of thumb: server-side use include
, precompiled browser use render
. If you're using vf-eleventy you should use include
.
include
You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include
is an abstraction of render
and provides some additional portability.
{% set context fromYourYamlFile %}
- or -
{% set context = {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"override_class" : "vf-logo--extreme",
"hidden_text" : false,
}
%}
{% include "../path_to/vf-logo/vf-logo.njk" %}
render
This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include
is not be available.
{% render '@vf-logo', {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"override_class" : "vf-logo--extreme",
"hidden_text" : false,}
%}
<a href="https://stable.visual-framework.dev/" class="vf-logo | vf-logo--has-text | vf-logo--extreme">
<img class="vf-logo__image" src="https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg" alt="Visual Framework" loading="eager">
<span class="vf-logo__text">Visual Framework</span>
</a>
Depending on your environment you'll want to use render
or include
. As a rule of thumb: server-side use include
, precompiled browser use render
. If you're using vf-eleventy you should use include
.
include
You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include
is an abstraction of render
and provides some additional portability.
{% set context fromYourYamlFile %}
- or -
{% set context = {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"hidden_text" : true,
}
%}
{% include "../path_to/vf-logo/vf-logo.njk" %}
render
This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include
is not be available.
{% render '@vf-logo', {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"hidden_text" : true,}
%}
<a href="https://stable.visual-framework.dev/" class="vf-logo | vf-logo--has-text">
<img class="vf-logo__image" src="https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg" alt="Visual Framework" loading="eager">
<span class="vf-logo__text vf-u-sr-only">Visual Framework</span>
</a>
Depending on your environment you'll want to use render
or include
. As a rule of thumb: server-side use include
, precompiled browser use render
. If you're using vf-eleventy you should use include
.
include
You'll need to pass a context object from your code or Yaml file (example), as well as the path to the Nunjucks template. Nunjucks' include
is an abstraction of render
and provides some additional portability.
{% set context fromYourYamlFile %}
- or -
{% set context = {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"override_class" : "vf-logo--extreme",
"hidden_text" : true,
}
%}
{% include "../path_to/vf-logo/vf-logo.njk" %}
render
This approach is best for bare-bones Nunjucks environments, such as precompiled templates with the Nunjucks slim runtime where include
is not be available.
{% render '@vf-logo', {
"component-type" : "element",
"logo_href" : "https://stable.visual-framework.dev/",
"logo_text" : "Visual Framework",
"image" : "https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg",
"override_class" : "vf-logo--extreme",
"hidden_text" : true,}
%}
<a href="https://stable.visual-framework.dev/" class="vf-logo | vf-logo--has-text | vf-logo--extreme">
<img class="vf-logo__image" src="https://assets.emblstatic.net/vf/v2.4.6/assets/vf-logo/assets/logo.svg" alt="Visual Framework" loading="eager">
<span class="vf-logo__text vf-u-sr-only">Visual Framework</span>
</a>
This component is distributed with npm. After installing npm, you can install the vf-logo
with this command.
$ yarn add --dev @visual-framework/vf-logo
The source files included are written in Sass(scss
). You can point your Sass include-path
at your node_modules
directory and import it like this.
@import "@visual-framework/vf-logo/index.scss";
Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter
set-
style functions to cleaner version--extrene
variation.v2.0.0
of the vf-design-tokens
package or newer
File system location: components/vf-logo
Find an issue on this page? Propose a change or discuss it.