Information

You appear to be using an unsupported browser, and it may not be able to display this site properly. You may wish to upgrade your browser.

Installation

How to start using the Design System in your project

The npm package for the Design System code has been renamed from @scottish-government/pattern-library to @scottish-government/design-system. Please update your projects to use the new package.

We recommend using npm to install the Design System and compiling the CSS from the source. This is because:

  • npm makes it easier for you to stay up to date with any additions or bug fixes
  • there are some easy component customisation options available to you if you compile the CSS yourself

What you need to do

  1. Install Node.js.

    We recommend using the latest Long Term Support (LTS) version.

  2. If your project does not already have a package.json file, create one by running this command from your project’s root folder:

    npm init
  3. Install a SASS compiler. We recommend installing Dart Sass into your project.

    npm install sass --save-dev
  4.  Install the Design System with this command:

    npm install @scottish-government/design-system --save-dev

    You’ll now have a copy of the Design System’s source code in your project’s node_modules folder.

Using the Design System

CSS and Sass

A precompiled CSS file containing the styles used by the Design System is included in the Design System’s npm package at /dist/css/main.css.

The Design System’s components are also provided as SCSS files. See the documentation about CSS and Sass for more information about how to work with the Design System's SCSS.

JavaScript

A precompiled JavaScript file containing all of the scripts for Design System components is provided in the Design System’s npm package at /dist/scripts/design-system.js.

See the documentation about JavaScript for more information about how to use the Design System's JavaScript in your projects.

Back to top