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) npm (tag) Fluid Licence

Storybook documentation

Vanilla storybook documentation open_in_new

Installation with 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@5.0.0-rc.1/lib/fluid-design-system.css">

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

You can include a specific version of scripts and styles using the url:

https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@x.y.z/lib/fluid-design-system.css
https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@x.y.z

Find out more links directly on JsDeliveropen_in_new

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 always include these fonts into the HTML head:

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

Installation with NPM

You can install the package inside your application from npmjs:

As Fluid 5 is still in early access, install the latest release candidate with:

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

Basic usage

1. 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 always include these fonts into the HTML head:

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

2. CSS

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

2.1 Include the full 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">
2.2 OR 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">

3. JavaScript

Not all components contain a Javascript file. Use the full library to avoid worrying about it.

3.1 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="/your-js-path/@engie-group/fluid-design-system@5.0.0-rc.1/lib/fluid-design-system.js"></script>
  <script src="/your-js-path/@engie-group/fluid-design-system@5.0.0-rc.1/lib/auto-init.js"></script>
 </body>
 </html>
3.2 OR a single component

Include the Collapse component UMD script:

<script src="/your-js-path/@engie-group/fluid-design-system@5.0.0-rc.1/lib/components/toggle/index.js"></script>
<script src="/your-js-path/@engie-group/fluid-design-system@5.0.0-rc.1/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…)

1. SCSS

ENGIE icon font path

In case you have to resolve relative path to ENGIE icons font file, you can set the $icon-font-path variable or use resolve-url-loader with webpack.
This is the default value : $icon-font-path: "./components/icon/fonts/" located in fluid-design-system.scss file.

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";

2. 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/toggle';

document.addEventListener('DOMContentLoaded', function(event) {
  Toggle.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.