import styled from '@emotion/styled';
import DoAccentColors from 'sentry-images/stories/color/do-accent-colors.svg';
import DoContrast from 'sentry-images/stories/color/do-contrast.svg';
import DoDifferentiation from 'sentry-images/stories/color/do-differentiation.svg';
import DontAccentColors from 'sentry-images/stories/color/dont-accent-colors.svg';
import DontContrast from 'sentry-images/stories/color/dont-contrast.svg';
import DontDifferentiation from 'sentry-images/stories/color/dont-differentiation.svg';
import ExternalLink from 'sentry/components/links/externalLink';
import Panel from 'sentry/components/panels/panel';
import PanelItem from 'sentry/components/panels/panelItem';
import ThemeToggle from 'sentry/components/stories/themeToggle';
import {IconCheckmark, IconClose} from 'sentry/icons';
import {space} from 'sentry/styles/space';
import theme, {ColorOrAlias} from 'sentry/utils/theme';
interface Palette {
color: ColorOrAlias;
text: ColorOrAlias;
}
const GRAY_PALETTES: Palette[][] = [
[{color: 'gray500', text: 'lightModeWhite'}],
[{color: 'gray400', text: 'lightModeWhite'}],
[{color: 'gray300', text: 'lightModeWhite'}],
[{color: 'gray200', text: 'lightModeBlack'}],
[{color: 'gray100', text: 'lightModeBlack'}],
];
const LEVELS_PALETTES: Palette[][] = [
[
{color: 'purple400', text: 'lightModeWhite'},
{color: 'purple300', text: 'lightModeWhite'},
{color: 'purple200', text: 'lightModeBlack'},
{color: 'purple100', text: 'lightModeBlack'},
],
[
{color: 'blue400', text: 'lightModeWhite'},
{color: 'blue300', text: 'lightModeWhite'},
{color: 'blue200', text: 'lightModeBlack'},
{color: 'blue100', text: 'lightModeBlack'},
],
[
{color: 'green400', text: 'lightModeWhite'},
{color: 'green300', text: 'lightModeBlack'},
{color: 'green200', text: 'lightModeBlack'},
{color: 'green100', text: 'lightModeBlack'},
],
[
{color: 'yellow400', text: 'lightModeBlack'},
{color: 'yellow300', text: 'lightModeBlack'},
{color: 'yellow200', text: 'lightModeBlack'},
{color: 'yellow100', text: 'lightModeBlack'},
],
[
{color: 'red400', text: 'lightModeWhite'},
{color: 'red300', text: 'lightModeWhite'},
{color: 'red200', text: 'lightModeBlack'},
{color: 'red100', text: 'lightModeBlack'},
],
[
{color: 'pink400', text: 'lightModeWhite'},
{color: 'pink300', text: 'lightModeWhite'},
{color: 'pink200', text: 'lightModeBlack'},
{color: 'pink100', text: 'lightModeBlack'},
],
];
const FixedWidth = styled('div')`
max-width: 800px;
`;
export default function ColorStories() {
return (
Sentry has a flexible, tiered color system that adapts to both light and dark
mode. Our color palette consists of neutral grays and 6 accent colors.
There are 5 shades of gray, ranging from Gray 500 (darkest) to Gray 100
(lightest).
Gray 300 and above are accessible foreground colors that conform
to{' '}
Here are the recommended use cases:
Accent colors help shift the user's focus to certain interactive and high-priority
elements, like links, buttons, and warning banners.
There are 6 hues to choose from. Each has specific connotations:
Each hue comes in 4 levels: 400 (dark), 300 (full opacity), 200 (medium opacity),
and 100 (low opacity).
When it comes to using color, there are two main accessibility concerns:
readability and separation.
In Sentry's color palette, only Gray 300 and above satisfy the contrast
requirement for normal text. This applies to both light and dark mode.
Accent colors in the 300 series, except for Yellow 300, satisfy the contrast
requirement for large text.
Color can be an effective way to visually separate elements in the user interface.
However, not all users see color in the same way. Some are color-blind and cannot
reliably differentiate one color from another. Some have color filters on their
screens, like Night Shift in MacOS. Others are in bright environments with high
levels of glare, reducing their ability to see color clearly.
As such, color is an unreliable way to separate elements. Whenever possible,
provide additional visual cues like icons, text labels, line type (solid, dashed,
dotted),… to further reinforce the separation.
Colors
Grays
Accent Colors
Hues
Levels
Accessibility
Readability
Separation