A collection of tools and libraries to implement the HSPH Design System.
Available tools:
HSPH Boostrap
An implementation of the Bootstrap CSS framework implementing the Harvard Chan brand.
How to use
IMPORTANT
HSPH Bootstrap is a special version of bootstrap compiled to be "no-conflict". All of the bootstrap rules are prefixed with a .hsph-bootstrap selector. Therefor you will need to add this selector to the body of the document if you want to use it on the entire page. Alternatively you can use wrapper <div> with this class to selectively enable bootstrap on specific sections of the page.
In your theme or plugin you can either directly enqueue the styles and optionally the scripts:
Direct enqueing
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:
By dependency
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' ) );
}
);