Mike Griffin

Getting Started with Primer CSS

Primer CSS is the framework that GitHub.com uses for its design and it has a whole bunch of well designed bits that go together. The documentation is really good and it’s easy to find most things.

The one thing I struggled with was trying to get a HTML page to hang the CSS bits off. Here’s what I ended up with:

<html lang="en">
    <meta charset="utf-8">
    <title>My Site</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/assets/css/primer.css">
    <div class="Header">
      <div class="Header-item">
        <a class="Header-link f4 d-flex flex-items-center" href="/">My Site</a>
    <div class="container-lg">
      <div class="p-5">
        <p>This is text</p>

It’s a fairly straightforward HTML5 layout with a Header at the top and a container-lg to hold the content in the main part. The documentation on containers and their sizes was hidden away at the bottom of the Objects > Grid section.

I hope this helps anyone that wants to start using Primer to style their site.