You are viewing an old version of this content. View the current version.
Compare with Current View Version History
« Previous Version 12 Next »
A collection of tools and libraries to implement the HSPH Design System.
Available tools:
An implementation of the Bootstrap CSS framework implementing the Harvard Chan brand.
In your theme or plugin you can either directly enqueue the styles and optionally the scripts:
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:
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' ) ); } );
Requirements: You need to have npm installed on your machine
`npm i
npm run bootstrap`
Demos are available here: https://harvardchanschool.github.io/plugin-design-system/
The Font Awesome 4.7 library is available for all to use in their themes and plugins
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'hsph-fontawesome' ); } );
Or if you have existing scripts and styles you can simply make hsph-fontawesome a dependency:
add_action( 'wp_enqueue_scripts', function () { // Enqueue the CSS files. wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array( 'hsph-fontawesome' ) ); } );
We include the entire library so there is not much to modify but if you ever need to rebuild it:
npm run fontawesome`
function use_hsph_design_system() { // Enqueue Bootstrap CSS files. wp_enqueue_style( 'hsph-bootstrap' ); // Enqueue Bootstrap JS files. wp_enqueue_script( 'hsph-bootstrap' ); // Enqueue Font Awesome CSS files. wp_enqueue_style( 'hsph-fontawesome' ); } add_action( 'wp_enqueue_scripts', 'use_hsph_design_system'); add_action( 'admin_enqueue_scripts', 'use_hsph_design_system');