Vanilla JS

Start with the installation and then feel free to explore the different sections of the design system to start building applications based on ENGIE standards.

npm (tag) Fluid Licence

Installation

NPM

Install the package inside your application from npmjs:

npm install @engie-group/fluid-design-system

CDN

When you only need to include compiled CSS or JS from Fluid, you can use our CDN links:

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest/lib/fluid-design-system.css">

<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest"></script>

Find out more links directly on JsDeliver

Fonts and icons

Fluid Design System uses the Lato font as global font family, read more about the typography on the dedicated section.

ENGIE has selected the Google material font as default icons pack, read more on the icons documentation.

Be sure to include these fonts into the HTML header:

<link href="https://fonts.googleapis.com/css?family=Material+Icons|Lato:300,400,700,900&display=swap" rel="stylesheet"/>

Basic usage

You can use the built files from the lib/ directory.

CSS

Make sure to include the Google material icons first.

Include the library

Copy-paste the stylesheet <link> into your <head> before all other stylesheets to load our CSS.

<link href="/your-css-path/fluid-design-system.css" rel="stylesheet">
Include a single component

Include the Toggle component styles only:

<link href="/your-css-path/reboot.css" rel="stylesheet">
<link href="/your-css-path/components/toggle/index.css" rel="stylesheet">

JavaScript

Not all components contain a Javascript file, use full library to avoid worrying about it.

Full Library

Place the following <script> near the end of your pages, right before the closing </body> tag, to enable components using JS.

 <html>
 <body>
  <!-- Engie components -->
  <script src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest"></script>
  <script src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest/lib/auto-init.js"></script>
 </body>
 </html>
Single component

Include the Collapse component UMD script:

<script src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest/lib/components/collapse/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@latest/lib/auto-init.js"></script>

Advanced usage

You can import the sources files from the src/ directory. Feel free to use your asset builder (Webpack, gulp, grunt…)

SCSS

Make sure to include the Google material icons first if you import the entire library or icon component.

Import the library

Import the library in your project:

@import "~@engie-group/fluid-design-system/src/fluid-design-system.scss";
Import a single component

Import the Toggle component file only:

@import "~@engie-group/fluid-design-system/src/components/toggle";

If the import is not working, use this one instead (see Index Files):

@import "~@engie-group/fluid-design-system/src/reboot";
@import "~@engie-group/fluid-design-system/src/components/toggle/_index";

JavaScript

Manual initialization for a single component

Components can be initiated manually

  • Import one component in your project.
import Collapse from '@engie-group/fluid-design-system/lib/components/collapse';

document.addEventListener('DOMContentLoaded', function(event) {
  Collapse.init();
});

Troubleshooting

If you have any issues while getting set up with Fluid Design System, please create an issue or a request on our library git repository.