The EMBL Layout System is applied to the Container components. It is an asymmetrical grid of four columns. There are 3 layout options.
All EMBL Layouts are single column until the viewport reaches "tablet" size. EMBL Layouts have two classes. One to define the grid area and where it is in the Page Grid another to determine what columns there are available.
The CSS classnames available should be used on their own on a Container or added to a Containers existing classname declaration in the HTML.
A EMBL Layout should only be applied to Containers. For Blocks you should use vf-grid
.
If the EMBL Layout System is being added to a Container that has a classname we separate the classes in the HTML with a |
.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus fugiat delectus dolore molestias rerum? Dolores doloribus impedit quasi provident odit perferendis vitae incidunt, mollitia repellendus a alias necessitatibus, molestiae! Nesciunt. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta dolor odit vel ipsa consequatur sunt, esse sapiente commodi harum velit asperiores quasi nostrum sint dolorem blanditiis eum magnam voluptatibus aliquam.
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" : "embl-layout",
"embl_grid__type" : "centered",
}
%}
{% include "../path_to/embl-grid/embl-grid.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 '@embl-grid', {
"component-type" : "embl-layout",
"embl_grid__type" : "centered",}
%}
<div class="embl-grid embl-grid--has-centered-content">
<div></div>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus fugiat delectus dolore molestias rerum? Dolores doloribus impedit quasi provident odit perferendis vitae incidunt, mollitia repellendus a alias necessitatibus, molestiae! Nesciunt. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta dolor odit vel ipsa consequatur sunt, esse sapiente commodi harum velit asperiores quasi nostrum sint dolorem blanditiis eum magnam voluptatibus aliquam.</p>
</div>
<div></div>
</div>
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" : "embl-layout",
"embl_grid__type" : "sidebar",
}
%}
{% include "../path_to/embl-grid/embl-grid.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 '@embl-grid', {
"component-type" : "embl-layout",
"embl_grid__type" : "sidebar",}
%}
<div class="embl-grid embl-grid--has-sidebar">
<div class="vf-section-header">
<h2 class="vf-section-header__heading"> Projects</h2>
</div>
<div class="vf-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus fugiat delectus dolore molestias rerum? Dolores doloribus impedit quasi provident odit perferendis vitae incidunt, mollitia repellendus a alias necessitatibus, molestiae! Nesciunt.</p>
</div>
<div class="vf-box vf-box-theme--primary vf-box--normal">
<h3 class="vf-box__heading">Did you know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
</div>
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" : "embl-layout",
"embl_grid__type" : "sidebar",
"embl_grid__hairline" : true,
}
%}
{% include "../path_to/embl-grid/embl-grid.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 '@embl-grid', {
"component-type" : "embl-layout",
"embl_grid__type" : "sidebar",
"embl_grid__hairline" : true,}
%}
<div class="embl-grid embl-grid--has-sidebar embl-grid-has-sidebar--hairline">
<div class="vf-section-header">
<h2 class="vf-section-header__heading"> Projects</h2>
</div>
<div class="vf-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Necessitatibus fugiat delectus dolore molestias rerum? Dolores doloribus impedit quasi provident odit perferendis vitae incidunt, mollitia repellendus a alias necessitatibus, molestiae! Nesciunt.</p>
</div>
<div class="vf-box vf-box-theme--primary vf-box--normal">
<h3 class="vf-box__heading">Did you know?</h3>
<p class="vf-box__text">This is some more content that would be in the box.</p>
</div>
</div>
This component is distributed with npm. After installing npm, you can install the embl-grid
with this command.
$ yarn add --dev @visual-framework/embl-grid
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-grid/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 versionauto
and 1fr
doing the opposite with the sidebarembl-grid
didn't allow for more 'main content' itemsembl-grid--has-sidebar
had it's auto and 1fr backwards--alt
version (use a utility class for background colour)--has-sidebar
and gives it it's own modifier class.embl-grid
uses [main-start]
and [main-end]
for more reliable positioning of child grids--page-grid-gap
custom property for sidebar gap; https://github.com/visual-framework/vf-core/pull/694
File system location: components/embl-grid
Find an issue on this page? Propose a change or discuss it.