EMBL’s primary corporate typeface is IBM Plex Sans. Subdomains should use the same font except for cases where they have a different brand guideline.
The vf-text component leverages the design token typography sizes.
The default font size for paragraphs is 19px.
Apply tokens, such as vf-text-body--1
to change the size and other stylistic elements of the default body text.
This component provides utility-like functionality and you'll rarely need to directly use this component. When coding a component's Sass, it will typically be better to use the mixins (@include set-type(text-body--1);
) than these
vf-text
classes.
Large body text
- The large body text variant is used for lead paragraphs and blockquotes.Default body text
- The default paragraph font size is 19px.Small body text
- Text smaller than 16px is defined as part of certain vf components. Avoid using this for standalone paragraph text because it can be too small to read.For more information on text please consult the following documents:
This is large body text
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",
"text" : "This is large body text",
"type" : 1,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is large body text",
"type" : 1,}
%}
<p class="vf-text-body vf-text-body--1">This is large body text</p>
This is the default paragraph text
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",
"text" : "This is the default paragraph text",
"type" : 2,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is the default paragraph text",
"type" : 2,}
%}
<p class="vf-text-body vf-text-body--2">This is the default paragraph text</p>
This is a small body text
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",
"text" : "This is a small body text",
"type" : 3,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is a small body text",
"type" : 3,}
%}
<p class="vf-text-body vf-text-body--3">This is a small body text</p>
This is an extra small bold body text
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",
"text" : "This is an extra small bold body text",
"type" : 4,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is an extra small bold body text",
"type" : 4,}
%}
<p class="vf-text-body vf-text-body--4">This is an extra small bold body text</p>
This is an extra small body text
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",
"text" : "This is an extra small body text",
"type" : 5,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is an extra small body text",
"type" : 5,}
%}
<p class="vf-text-body vf-text-body--5">This is an extra small body text</p>
This is an extra extra small body text
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",
"text" : "This is an extra extra small body text",
"type" : 6,
}
%}
{% include "../path_to/vf-text/vf-text.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-text', {
"component-type" : "element",
"text" : "This is an extra extra small body text",
"type" : 6,}
%}
<p class="vf-text-body vf-text-body--6">This is an extra extra small body text</p>
This component is distributed with npm. After installing npm, you can install the vf-text
with this command.
$ yarn add --dev @visual-framework/vf-text
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-text/index.scss";
Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter
File system location: components/vf-text
Find an issue on this page? Propose a change or discuss it.