Typography
Typography provides the core structure of a well-designed interface. Gatsby’s typography strives to create clear hierarchies, useful organizations, and purposeful alignments that guide the user through content, product, and experience.
Font stack
Gatsby uses the all-time classic Futura for headlines and display copy. Long form text such as articles and documentation currently use the native font stack, but we are actively looking for a serif to increase the reading experience.
The native font stack
The “native font stack” depends on the user’s operating system and device; depending on that, we use San Francisco UI, Roboto or Segoe UI.
Our monospace font stack also makes use of the default fonts available: That’s usually San Francisco Mono, Menlo or Monaco on Mac OS X, Consolas on Windows, or Liberation Sans on Linux distributions.
In our (Figma, Sketch, etc.) designs we use Roboto as it’s easily available.
Scale
Since our primary use for the design system is interface design, our typographic scale is hand-crafted. This way we don’t have to worry about decimals in our design tools or when calculating line heights, don’t have to worry about subpixel rounding errors, and have total control over which sizes exist instead of outsourcing that job to a mathematical formula.
For long form content like articles, using a modular scale is totally fine though. Typography.js makes setting up and using such a scale easy.
fontSizes[0]
fontSizes[1]
fontSizes[2]
fontSizes[3]
fontSizes[4]
fontSizes[5]
fontSizes[6]
fontSizes[7]
fontSizes[8]
fontSizes[9]
fontSizes[10]
fontSizes[11]
fontSizes[12]
fontSizes[13]
fontSizes[14]
fontSizes[15]
fontSizes[16]
Weights, letter spacings and line heights
A note on Futura PT Bold: While Futura PT Bold works well at display size, it gets hard to read below ~30px. For screens, use it for the page title (once per page). Do not use it for "bold" text—that is the job of Futura PT Demi.
Font Weights
fontWeights.extraBold
Use this for the main headline, set in Futura PT Bold, only.
fontWeights.bold
— bold
Use this for the all headlines but the main page title, and to emphasize text throughout regular copy.
fontWeights.body
— normal
Letter Spacing
Letterspacing (also known as character spacing or tracking) is the adjustment of the horizontal white space between the letters in a block of text. Tokens are intended for use with the letter-spacing
CSS property.
Normal — letterSpacings.normal
— normal
Use for almost everything.
Tight — letterSpacings.tight
— -0.015em
Use for headlines set in Futura PT.
Create digital experiences on the edge—faster
Tracked — letterSpacings.tracked
— 0.075em
Use for small caps, particularly at small sizes — when using capital letters together, the default spacing looks too tight.
Line Heights
Default — lineHeights.default
— 1.5
It eluded us then, but that’s no matter—tomorrow we will run faster, stretch out our arms farther. . . . And then one fine morning— So we beat on, boats against the current, borne back ceaselessly into the past.
Solid — lineHeights.solid
— 1
Scale to the entire internet
Dense — lineHeights.dense
— 1.25
Stop managing content.
Start telling your story.
Loose — lineHeights.loose
— 1.75
As a popular and growing framework for building websites and web applications, Gatsby is in a position to make an impact for accessibility and people with disabilities. The Gatsby team is passionate about helping you create websites that work for everyone, with helpful defaults that bake in web accessibility as well as performance optimizations.
Sample hierarchies
A couple of usage examples — currently, these are rough PoC-style styled-system remodels of components used on our website. Ideally, this section will be built using these "live" components.
The Future is Fast
Create digital experiences on the edge—faster
Gatsby provides a modern framework for turning content into feature-rich, visually engaging apps and websites.
Over the last few years, the modern JavaScript ecosystem has created tools that allow developers to build quicker with fewer bugs. Gatsby gives you easy access to features like modern JavaScript syntax, code bundling and hot reloading, without having to maintain custom tooling. Build app-like experiences faster — with Gatsby.
Websites come in a thousand different flavors. Timeframes, budgets, interactivity requirements and content systems can vary wildly from one project to the next.
This variety puts website teams between a rock and a hard place. They often have to maintain frontends built in multiple development systems, stretching their developers’ skill sets. Implementing the same dropdown in five different frameworks can be a huge headache. But what’s the alternative — turn down good client projects?
To add to the difficulty, when your UI development framework is coupled to your client’s CMS backend, it doesn’t just cause technical problems; it causes people problems. It makes your team’s staffing plans dependent on specific projects. It hamstrings your ability to respond to changing client requirements by shifting resources around.
Stop managing content.
Start telling your story.
Gatsby brings your content to the edge for lightning fast, safe website delivery with no CMS overhead.
Modern web tech without the headache
Bring your own data
Future-proof your website
Scale to the entire internet
Speed past the competition
Static Progressive Web Apps
gatsby-starter-personal-blog
Using decoupled Drupal with Gatsby with Kyle Mathews
Documentation
- Introduction
- Quickstart
- Recipes
Guides
- Preparing your environment
- Deploying & hosting
- Custom configuration
- Images and files
- Sourcing content and data
- Querying your data with GraphQl
- Plugins
- Starters
- Styling your site
- Adding testing
- Debugging Gatsby
- Adding website functionality
- Improving performance
- Localizing your site
How we're migrating a government open data site to Gatsby
React Hooks are cool. Besides simplifying your code and removing the need for a lot of boilerplate associated with classes in JavaScript (looking at you, this
), they enable some serious shareability. They also make it possible to use state in functional components.
You can probably tell that we’ve been super excited about React Hooks. So when they finally landed in React 16.8, we figured it was time to give our very own StaticQuery
component the hook treatment!
Baking PWAs, React and GraphQL into a web framework
One of Gatsby’s goals is to provider users all the benefits of modern web out of the box, from implementing a Progressive Web App (PWA) checklist of features, React, accessibility by default, CSS-in-JS support, headless CMSs, and GraphQL.
No more Render Props necessary to use a Static Query
This simplifies accessing data in your components and also keeps your component tree shallow.
Let’s quickly check out a basic example. Here’s a typical Header component, first written using StaticQuery
and then useStaticQuery
.