The Breakthrough T1D Design System is a collection of components designed to maintain consistency across the project’s front-end development. It is available as a GitLab repository, which contains all the necessary files to get started, including CSS, JavaScript, images, and SVG assets. This allows developers to get up and running with minimal setup. Follow the steps below to set up the design system for your project.
Make sure you have the following installed on your local environment:
Start by cloning the design system repository to your local environment using Git:
git clone git@gitlab.10up.com:jdrf/breakthrough-t1d-design-system.git
Once cloned, navigate into the project directory and install the necessary npm dependencies:
cd your-repo-directory
npm install
After installing the dependencies, build the design system by running the following command:
npm run build
This command will compile all assets, including CSS, JavaScript, images, and SVGs, into the dist
folder. The compiled assets are optimized for use in your project.
The design system uses 10up’s Toolkit for compiling and optimizing assets. The toolkit simplifies the development workflow by automating tasks such as compiling CSS, JavaScript, and SVGs, and ensuring all assets are optimized for production.
To utilize the design system’s icons, you need to copy the svg
directory from the dist
folder into your project. This directory contains the SVG sprite and individual icons essential for icon usage across the design system.
In order to apply the design system’s styles and functionality, enqueue the compiled CSS and JavaScript files (bt1d-frontend-css.css
and bt1d-frontend-js.js
) into your site or HTML.
Here’s an example of how to include these files in your HTML:
<!-- Include the compiled CSS -->
<link rel="stylesheet" href="path/to/dist/bt1d-frontend-css.css">
<!-- Include the compiled JavaScript -->
<script src="path/to/dist/bt1d-frontend-js.js"></script>
Make sure to replace path/to/dist/
with the actual location where the compiled assets are stored in your project.
The design system includes an SVG sprite to manage icons efficiently. By default, the sprite is compiled when you run the npm run build
command. However, if you specifically need to update or rebuild the SVG sprite, use the following command:
npm run build:svg-sprite
This command will compile all SVG files into a single sprite, optimized for performance. You can reference the icons from the sprite using use
elements with appropriate ID
references throughout the design system.
The repository is organized as follows:
assets/
– The source directory containing all the CSS, JavaScript, and SVG files used for development.
css/
– Source styles for the design system.js/
– Source JavaScript files for the design system.svg/
– Source SVG files, including individual icons.dist/
– The compiled directory that contains the optimized assets ready for production.
css/
– Compiled and minified CSS.js/
– Compiled and minified JavaScript.svg/
– Compiled SVG sprite and optimized icons.You can easily customize components in the design system using utility classes or overriding variables. For example, to change the background color of an element, you can use the bt1d-navy-background-color
utility class.
If you need further customization, you can modify the CSS variables in the assets/css/global/tokens.css
file and rebuild the design system.
The Breakthrough T1D Design System is tested on modern browsers including:
For older browsers (e.g., Internet Explorer 11), certain features may require polyfills or may not be fully supported.