EMBL Logo embl-element

The EMBL logo.

github location npm version

Variants

Nunjucks syntax

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.

Using 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" : "embl-element",
"logo_text" : "European Molecular Biology Laboratory Home",
"logo_href" : "/",
 }
%}
{% include "../path_to/embl-logo/embl-logo.njk" %}
                

Using 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 '@embl-logo', {
  "component-type" : "embl-element",
  "logo_text" : "European Molecular Biology Laboratory Home",
  "logo_href" : "/",}
%}
                
HTML
<a href="/" class="embl-logo">
  <span class="vf-u-sr-only" for="text">European Molecular Biology Laboratory Home</span>
</a>
              

Examples

Installation info

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

$ yarn add --dev @visual-framework/embl-logo

Sass/CSS

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/embl-logo/index.scss";

Make sure you import Sass requirements along with the modules. You can use a project boilerplate or the vf-sass-starter

Changelog

Changelog

1.2.0

  • hides the --extreme variant.

1.1.0

  • removes some unneeded CSS.
  • makes the maximum height 3rem (48px).
  • makes the logo responsive.
  • deprecates --extreme.

1.0.5

  • makes a reduction in size for the logos --extreme version from 96px to 48px

1.0.3

  • this removes the 'resize' for homepages as on devices sub 1024px the logo was a different size to every other page

1.0.2

  • bug: logo did not show correctly inside flex-based containers like vf-global-header

1.0.1 (2020-01-24)

  • Adds a large "extreme" variant for use on the homepage

1.0.0 (2019-12-17)

  • Initial stable release

Assets



File system location: components/embl-logo

Find an issue on this page? Propose a change or discuss it.