Versions Compared
Version | Old Version 8 | New Version 9 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
A collection of tools and libraries to implement the HSPH Design System
Available tools:
Table of Contents | ||||
---|---|---|---|---|
|
HSPH Boostrap
An implementation of the Bootstrap CSS framework implementing the Harvard Chan brand.
How to use
In your theme or plugin you can either directly enqueue the styles and optionally the scripts:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'hsph-bootstrap' ); // Optionnaly: Enqueue JS if you want to use tabs, drop-downs, modals, tooltips, ... wp_enqueue_script( 'hsph-bootstrap' ); } ); |
Or if you have existing scripts and styles you can simply make hsph-bootstrap a dependency:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array( 'hsph-bootstrap' ) ); // Optionnaly: Enqueue JS if you want to use tabs, dropdowns, modals, tooltips, ... wp_enqueue_script( 'theme-scripts', get_stylesheet_directory_uri() . '/js/main.js', array( 'jquery', 'hsph-bootstrap' ) ); } ); |
Info |
---|
Refer to the official documentation on how to use Bootstrap in your theme: https://getbootstrap.com/docs/4.4/getting-started/introduction/ |
How to Modify
Requirements: You need to have npm installed on your machine
- Clone the repo locally https://github.com/HarvardChanSchool/plugin-design-system
- In a terminal, navigate to the cloned folder and run
`npm i
` to install the dev tools - Make changes to /assets/sass/hsph-bootstrap/_bootstrap-vars.scss
- Additionally: more advanced changes can be made to existing or new partial sass files
- Compile your changes by running `
npm run bootstrap`
- You can preview your changes by visiting the local html files in /docs/ in your browser.
- Once you are satisfied, commit change to the repo.
Demos
Demos are available here: https://harvardchanschool.github.io/plugin-design-system/
HSPH Font Awesome
The Font Awesome 4.7 library is available for all to use in their themes and plugins
How to use
In your theme or plugin you can either directly enqueue the styles and optionally the scripts:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'hsph-fontawesome' ); // Optionnaly: Enqueue JS if you want to use tabs, drop-downs, modals, tooltips, ... wp_enqueue_script( 'hsph-fontawesome' ); } ); |
Or if you have existing scripts and styles you can simply make hsph-fontawesome a dependency:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array( 'hsph-fontawesome' ) ); // Optionnaly: Enqueue JS if you want to use tabs, dropdowns, modals, tooltips, ... wp_enqueue_script( 'theme-scripts', get_stylesheet_directory_uri() . '/js/main.js', array( 'jquery', 'hsph-fontawesome' ) ); } ); |
Info |
---|
Refer to the official documentation on how to use Font Awesome in your theme: https://fontawesome.com/v4.7.0/examples/ |
How to modify
We include the entire library so there is not much to modify but if you ever need to rebuild it:
Requirements: You need to have npm installed on your machine
- Clone the repo locally https://github.com/HarvardChanSchool/plugin-design-system
- In a terminal, navigate to the cloned folder and run
`npm i
` to install the dev tools - Compile your changes by running `
npm run fontawesome`
- Commit change to the repo.