Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
All Emotion components we build have access to a typed theme object allowing you to have direct access to all the design tokens without any imports.
These are most easily available through our context and accessed via our gamut-styles
utility functions.
import { css } from '@codecademy/gamut-styles'; import styled from '@emotion/styled'; // Single value using static color const Box = styled.div(css({ bg: 'navy-400', p: 4 })); // Multiple values using ColorMode semantic color const OtherCoolThing = styled.div(css({ color: 'primary', p: 4 }));
They can also be accessed directly as the theme
prop on every styled component.
import styled from '@emotion/styled'; const styles = styled.div` blue: ${({ theme }) => theme.colors.blue}; `;
Or by importing the object from @codecademy/gamut-styles
if you are not using a ThemeProvider
in your app.
import { css } from '@emotion/react'; import { theme } from '@codecademy/gamut-styles'; const myStyles = css` font-size: ${theme.fontSize[14]}; `;
Key: theme.colors
All current visual identity colors are available on the colors
key on the Theme object, this includes named standard colors and their respective swatches.
Standard color atoms we select from in creating designs. All colors on Codecademy properties should adhere to these. Remember your accessibility contrast requirements too!
beige
theme.colors.beige
blue
theme.colors.blue
green
theme.colors.green
hyper
theme.colors.hyper
lightBlue
theme.colors.lightBlue
lightGreen
theme.colors.lightGreen
navy
theme.colors.navy
orange
theme.colors.orange
paleBlue
theme.colors.paleBlue
paleGreen
theme.colors.paleGreen
palePink
theme.colors.palePink
paleYellow
theme.colors.paleYellow
pink
theme.colors.pink
paleRed
theme.colors.paleRed
red
theme.colors.red
yellow
theme.colors.yellow
black
theme.colors.black
white
theme.colors.white
Swatch colors are accessible with a dashcase key theme.colors['${color}-${weight}']
. Here's a list of all the solid swatches available.
beige
theme.colors[`beige-100`]
blue
theme.colors[`blue-0`]
green
theme.colors[`green-0`]
yellow
theme.colors[`yellow-0`]
pink
theme.colors[`pink-0`]
red
theme.colors[`red-0`]
orange
theme.colors[`orange-100`]
hyper
theme.colors[`hyper-400`]
gray
theme.colors[`gray-100`]
With the exception of the weight-100
, navy-800
, and navy-900
color weights, our navy and white color weights are semi-transparent. Special consideration should be taken when using these colors, especially when overlapping. The white weights, with the non-transparent exceptions, are only visible in dark mode, and the navy weights, with the non-transparent exceptions, are only visible in light mode. You can swap modes using the Color Mode
toggle at the top of this screen.
These tokens are also accessible with a dashcase key theme.colors['${color}-${weight}']
.
navy
theme.colors[`navy-100`]
white
theme.colors[`white-100`]
We have 2 core color modes that we support: light
and dark
.
Each color mode consists of a set of aliased color tokens. Each alias has semantic meaning for how the color is used throughout our design system:
text
: The standard text color for all type.background
: The base background color.primary
: The color used for interactive elements with a primary action.secondary
: The color used for interactive elements with a secondary action.For more on Color Modes please checkout the full color mode documentation
text
theme.colors.text
text-accent
theme.colors.text-accent
text-disabled
theme.colors.text-disabled
text-secondary
theme.colors.text-secondary
feedback-error
theme.colors.feedback-error
feedback-success
theme.colors.feedback-success
feedback-warning
theme.colors.feedback-warning
background
theme.colors.background
background-contrast
theme.colors.background-contrast
background-current
theme.colors.background-current
background-primary
theme.colors.background-primary
background-selected
theme.colors.background-selected
background-disabled
theme.colors.background-disabled
background-hover
theme.colors.background-hover
shadow-primary
theme.colors.shadow-primary
shadow-secondary
theme.colors.shadow-secondary
primary
theme.colors.primary
primary-hover
theme.colors.primary-hover
primary-inverse
theme.colors.primary-inverse
secondary
theme.colors.secondary
secondary-hover
theme.colors.secondary-hover
danger
theme.colors.danger
danger-hover
theme.colors.danger-hover
interface
theme.colors.interface
interface-hover
theme.colors.interface-hover
border-primary
theme.colors.border-primary
border-secondary
theme.colors.border-secondary
border-tertiary
theme.colors.border-tertiary
border-disabled
theme.colors.border-disabled
Example
text
theme.colors.text
text-accent
theme.colors.text-accent
text-disabled
theme.colors.text-disabled
text-secondary
theme.colors.text-secondary
feedback-error
theme.colors.feedback-error
feedback-success
theme.colors.feedback-success
feedback-warning
theme.colors.feedback-warning
background
theme.colors.background
background-contrast
theme.colors.background-contrast
background-current
theme.colors.background-current
background-primary
theme.colors.background-primary
background-selected
theme.colors.background-selected
background-disabled
theme.colors.background-disabled
background-hover
theme.colors.background-hover
shadow-primary
theme.colors.shadow-primary
shadow-secondary
theme.colors.shadow-secondary
primary
theme.colors.primary
primary-hover
theme.colors.primary-hover
primary-inverse
theme.colors.primary-inverse
secondary
theme.colors.secondary
secondary-hover
theme.colors.secondary-hover
danger
theme.colors.danger
danger-hover
theme.colors.danger-hover
interface
theme.colors.interface
interface-hover
theme.colors.interface-hover
border-primary
theme.colors.border-primary
border-secondary
theme.colors.border-secondary
border-tertiary
theme.colors.border-tertiary
border-disabled
theme.colors.border-disabled
Key: theme.fontFamily
accent
theme.fontFamily.accent
"Suisse"
base
theme.fontFamily.base
"Apercu"
monospace
theme.fontFamily.monospace
Monaco
system
theme.fontFamily.system
-apple-system
Key: theme.fontSize
14
theme.fontSize[14]
0.875rem
16
theme.fontSize[16]
1rem
18
theme.fontSize[18]
1.125rem
20
theme.fontSize[20]
1.25rem
22
theme.fontSize[22]
1.375rem
26
theme.fontSize[26]
1.625rem
34
theme.fontSize[34]
2.125rem
44
theme.fontSize[44]
2.75rem
64
theme.fontSize[64]
4rem
Key: theme.fontWeight
400
theme.fontWeight.400
400
700
theme.fontWeight.700
700
base
theme.fontWeight.base
400
title
theme.fontWeight.title
700
Key: theme.lineHeight
base
theme.lineHeight[base]
1.5
spacedTitle
theme.lineHeight[spacedTitle]
1.3
title
theme.lineHeight[title]
1.2
Key: theme.spacing
0
theme.spacing[0]
0
4
theme.spacing[4]
0.25rem
8
theme.spacing[8]
0.5rem
12
theme.spacing[12]
0.75rem
16
theme.spacing[16]
1rem
24
theme.spacing[24]
1.5rem
32
theme.spacing[32]
2rem
40
theme.spacing[40]
2.5rem
48
theme.spacing[48]
3rem
64
theme.spacing[64]
4rem
96
theme.spacing[96]
6rem
Key: theme.breakpoints
xs
theme.breakpoints[xs]
@media only screen and (min-width: 480px)
sm
theme.breakpoints[sm]
@media only screen and (min-width: 768px)
md
theme.breakpoints[md]
@media only screen and (min-width: 1024px)
lg
theme.breakpoints[lg]
@media only screen and (min-width: 1200px)
xl
theme.breakpoints[xl]
@media only screen and (min-width: 1440px)
Key: theme.borderRadii
none
theme.borderRadii.none
0px
sm
theme.borderRadii.sm
2px
md
theme.borderRadii.md
4px
lg
theme.borderRadii.lg
8px
xl
theme.borderRadii.xl
16px
full
theme.borderRadii.full
999px