Underdog.io's front end styleguide.
Pup defines a common set of components, patterns, and static assets that are used to create a coherent visual style and user experience across all of Underdog.io's products.
The styleguide contains things like:
Table of contents
You can use Pup in your project by installing it with npm:
yarn add underdog-pup@<VERSION># Exampleyarn add firstname.lastname@example.org
After installing Pup, you can then include individual components in your project.
In order to make use of Pup, your project must have support for the following:
For an example of how to set up a build system that uses Pup, check out the package.json file for this repo.
Before importing components, you must import shared Sass functions, variables, and mixins before you import any components, like so:
// Import shared SCSS;// Import individual components;;;
All components export a function that initializes the component.
// Import polyfills;// Import and initialze individual components;
Favicons are kept under
favicons/*. In order to use these favicons you must copy them into your project.
You must also update the paths to the favicons in
<head /> tag of your HTML document.
Updating browserconfig.xml and manifest.json
manifest.json are assuming that icons are being served from
/. The path to each icon defined in these files must be manually updated to match the path where the favicons are being served from.
Markup for importing icons in an HTML document
You must include the following markup in the
<head /> tag of the HTML document you want the favicons to be displayed for.
Note: The following markup is assuming that icons are being served from the root (
You must manually update the paths for each icon to the actual path where the favicons are being served from.
We use a custom icon font which is generated from individual SVGs stored in
In order to utilize the icon font that is generated in this project you will need to copy the fonts into your project.
If you are using the icon font in your project you will also have to override the
$icon-font-path variable to ensure the fonts get loaded properly.
Images that are shared by all of our projects, such as our logo and illustrations, are kept under the
Your local machine must be running Node v6.4.0.
Running a local development server
First, install dependencies with
yarn develop to start a development server and watch script that will rebuild assets whenever you make a change to a file.
To see what other scripts are available, run
Publishing a new version to npm
Run the following to publish a new version of
underdog-pup to npm:
- Bump the version in
package.jsonand create a new tag, following semantic versioning:
npm version <major|minor|patch>
- Push the updated package.json and new tag to master:
git push origin master --tags
- Publish to npm:
For guidelines on modifying the styleguide, please see CONTRIBUTING.md.