Building Stacks

The following is a guide to building and running Stacks locally. You’ll need to be able to build Stacks to contribute to our documentation or add new classes to our CSS library.

Clone the repo

There are two common ways to clone a repo:

  • Use the command line: git clone https://github.com/StackExchange/Stacks.git
  • Use GitHub’s desktop app.
    1. Download and install GitHub Desktop.
    2. Login with your GitHub credentials.
    3. Clone the Stacks repo.

Get Node and NPM installed

We use a bunch of NPM dependencies to process and package up Stacks for delivery. You’ll need to install them.

  1. Install Node & NPM
  2. Open the Stacks repo in a Terminal window.
  3. Install the NPM dependencies. npm run init-docs

Running Stacks

That should do it for all our dependencies. You’re now able to run Stacks.

  1. From the top level of the Stacks repo, run our main script npm start
  2. Visit your local copy of Stacks at http://localhost:8080/

Updating icons

If you hit a build error saying something like no such file or directory, open '_includes/svg-icons/some-icon.svg, run either npm run init-docs or npm run update-icons from the Stacks root.

Getting help

Installing dependencies can be frustrating, and we’re here to help. If you’re stuck, the Stacks team is always available in #stacks. If that doesn’t work, try opening an issue.