Design System
An evolving design system for my site
Tokens - Palette
wipThe available colour tokens
AaAa
bg-white
#FFFFFF
bg-white
AaAa
bg-slate-100
#F1F5F9
bg-slate-100
AaAa
bg-gray-100
#F3F4F6
bg-gray-100
AaAa
bg-gray-500
#6B7280
bg-gray-500
AaAa
bg-gray-700
#374151
bg-gray-700
AaAa
bg-gray-900
#111827
bg-gray-900
AaAa
bg-green-100
#ECFCCB
bg-green-100
AaAa
bg-yellow-100
#FEF9C3
bg-yellow-100
AaAa
bg-red-100
#FEE2E2
bg-red-100
AaAa
bg-red-vibrant
#FF0000
bg-red-vibrant
AaAa
bg-blue-600
#FEE2E2
bg-blue-600
Tokens - Spacing - Padding/Margin
wipThe avaliable spacing tokens
- 011 usages
- 0.53 usages
- 127 usages
- 220 usages
- 2.53 usages
- 319 usages
- 439 usages
- 52 usages
- 67 usages
- 813 usages
- 102 usages
- 122 usages
- 144 usages
- 162 usages
- 241 usages
- 321 usages
- 361 usages
Tokens - Spacing - Gap
wipThe avaliable spacing tokens
- 03 usages
- 0.53 usages
- 16 usages
- 28 usages
- 2.51 usages
- 310 usages
- 412 usages
- 67 usages
- 87 usages
- 104 usages
- 142 usages
- 241 usages
Tokens - Spacing - Standardised
wipThe proposed avaliable spacing tokens for all types of spacing - (?:m|p)(?:b|t|l|r|y|x)?-(?:d{1,2}|0|auto) src/**/*.{astro,ts,tsx}
- 0none3 usages
- 0.5micro3 usages
- 1xxx-small6 usages
- 2xx-small8 usages
- 2.5x-small4 usages
- 3small10 usages
- 4medium12 usages
- 5moderate3 usages
- 6large7 usages
- 8x-large7 usages
- 10xx-large4 usages
- 12xxx-large2 usages
- 14spacious6 usages
- 16x-spacious9 usages
- 24xx-spacious1 usages
- 32xxx-spacious1 usages
- 36expansive1 usages
- 60x-expansive1 usages
- 96xx-expansive1 usages
Foundation Types
reviewUnderlying foundation types used in the design system
Code
import clsx from 'clsx';
export type Spacing =
| 'none'
| 'auto'
| 'micro'
| 'xxx-small'
| 'xx-small'
| 'x-small'
| 'small'
| 'medium'
| 'moderate'
| 'large'
| 'x-large'
| 'xx-large'
| 'xxx-large'
| 'spacious'
| 'x-spacious'
| 'xx-spacious'
| 'xxx-spacious'
| 'expansive'
| 'x-expansive'
| 'xx-expansive';
export type ResponsiveStyle<T> = Readonly<{
mobile?: T,
tablet?: T,
desktop?: T,
wide?: T,
}>;
export type Margin = Spacing | ResponsiveStyle<Spacing>;
export type MarginX = Spacing | ResponsiveStyle<Spacing>;
export type MarginY = Spacing | ResponsiveStyle<Spacing>;
export type MarginTop = Spacing | ResponsiveStyle<Spacing>;
export type MarginBottom = Spacing | ResponsiveStyle<Spacing>;
export type MarginLeft = Spacing | ResponsiveStyle<Spacing>;
export type MarginRight = Spacing | ResponsiveStyle<Spacing>;
export type Padding = Spacing | ResponsiveStyle<Spacing>;
export type PaddingX = Spacing | ResponsiveStyle<Spacing>;
export type PaddingY = Spacing | ResponsiveStyle<Spacing>;
export type PaddingTop = Spacing | ResponsiveStyle<Spacing>;
export type PaddingBottom = Spacing | ResponsiveStyle<Spacing>;
export type PaddingLeft = Spacing | ResponsiveStyle<Spacing>;
export type PaddingRight = Spacing | ResponsiveStyle<Spacing>;
export type Top = Spacing | ResponsiveStyle<Spacing>;
export type Bottom = Spacing | ResponsiveStyle<Spacing>;
export type Left = Spacing | ResponsiveStyle<Spacing>;
export type Right = Spacing | ResponsiveStyle<Spacing>;
export type Height = Spacing | 'full' | ResponsiveStyle<Spacing | 'full'>;
export type MaximumHeight = Spacing | 'full' | ResponsiveStyle<Spacing | 'full'>;
export type MinimumHeight = Spacing | ResponsiveStyle<Spacing>;
export type Width = Spacing | 'full' | ResponsiveStyle<Spacing | 'full'>;
export type MaximumWidth = Spacing | 'full' | ResponsiveStyle<Spacing | 'full'>;
export type MinimumWidth = Spacing | ResponsiveStyle<Spacing>;
export type DisplayValue =
| 'block'
| 'flex'
| 'inline'
| 'inlineBlock'
| 'none';
export type Display = DisplayValue | ResponsiveStyle<DisplayValue>;
export type PositionValue =
| 'static'
| 'relative'
| 'absolute'
| 'fixed'
| 'sticky';
export type Position = PositionValue | ResponsiveStyle<PositionValue>
export type AlignValue =
| 'flexStart'
| 'flexEnd'
| 'center'
| 'baseline'
| 'stretch';
export type Align = AlignValue | ResponsiveStyle<AlignValue>;
export type JustifyContentValue =
| 'normal'
| 'flexStart'
| 'flexEnd'
| 'center'
| 'spaceBetween'
| 'spaceAround'
| 'spaceEvenly'
| 'stretch';
export type JustifyContent = JustifyContentValue | ResponsiveStyle<JustifyContentValue>;
export type FlexDirectionValue =
| 'row'
| 'rowReverse'
| 'column'
| 'columnReverse';
export type FlexDirection = FlexDirectionValue | ResponsiveStyle<FlexDirectionValue>;
export type FlexWrapValue =
| 'wrap'
| 'wrapReverse'
| 'noWrap';
export type FlexWrap = FlexWrapValue | ResponsiveStyle<FlexWrapValue>;
export type FlexShrinkValue =
| 0
| 1;
export type FlexShrink = FlexDirectionValue | ResponsiveStyle<FlexShrinkValue>;
export type FlexGrowValue =
| 0
| 1;
export type FlexGrow = FlexGrowValue | ResponsiveStyle<FlexGrowValue>;
export type OverflowValue =
| 'auto'
| 'hidden'
| 'clip'
| 'visible'
| 'scroll';
export type Overflow = OverflowValue | ResponsiveStyle<OverflowValue>;
export type ZIndexValue =
| 0
| 1
| 2
| 3;
export type ZIndex = ZIndexValue | ResponsiveStyle<ZIndexValue>;
export type TextAlignValue =
| 'left'
| 'center'
| 'right'
| 'justify'
| 'start'
| 'end';
export type TextAlign = TextAlignValue | ResponsiveStyle<TextAlignValue>;
type Styles = Partial<{
margin: Margin,
marginX: MarginX,
marginY: MarginY,
marginTop: MarginTop,
marginBottom: MarginBottom,
marginLeft: MarginLeft,
marginRight: MarginRight,
padding: Padding,
paddingX: PaddingX,
paddingY: PaddingY,
paddingTop: PaddingTop,
paddingBottom: PaddingBottom,
paddingLeft: PaddingLeft,
paddingRight: PaddingRight,
top: Top,
bottom: Bottom,
left: Left,
right: Right,
height: Height,
maxHeight: MaximumHeight,
minHeight: MinimumHeight,
width: Width,
maxWidth: MaximumWidth,
minWidth: MinimumWidth,
display: Display,
position: Position,
alignItems: Align,
alignContent: Align,
justifyContent: JustifyContent,
flexDirection: FlexDirection,
flexWrap: FlexWrap,
flexShrink: FlexShrink,
flexGrow: FlexGrow,
overflow: Overflow,
zIndex: ZIndex,
textAlign: TextAlign,
}>;
// const lookup: Record<Spacing, Record<keyof Styles, string>> = {
// 'none': {
// margin: 'm-0',
// marginX: 'mx-0',
// marginY: 'my-0',
// marginTop: 'mt-0',
// marginBottom: 'mb-0',
// marginLeft: 'ml-0',
// marginRight: 'mr-0',
// padding: 'p-0',
// paddingX: 'px-0',
// paddingY: 'py-0',
// paddingTop: 'pt-0',
// paddingBottom: 'pb-0',
// paddingLeft: 'pl-0',
// paddingRight: 'pr-0',
// top: 'top-0',
// bottom: 'bottom-0',
// left: 'left-0',
// right: 'right-0',
// height: 'h-0',
// maxHeight: 'max-h-0',
// minHeight: 'min-h-0',
// width: 'w-0',
// maxWidth: 'max-w-0',
// minWidth: 'min-w-0',
// display: 'd-none',
// position: 'position-static',
// alignItems: 'align-items-stretch',
// alignContent: 'align-content-stretch',
// justifyContent: 'justify-content-start',
// flexDirection: 'flex-direction-row',
// flexWrap: 'flex-wrap-no-wrap',
// flexShrink: 'flex-shrink-0',
// flexGrow: 'flex-grow-0',
// overflow: 'overflow-visible',
// zIndex: 'z-0',
// textAlign: 'text-left',
// },
// 'auto': {
// },
// }
// const marginMap: Record<Spacing, string> = {
// 'none': '',
// 'auto': '',
// 'micro': '',
// 'xxx-small': '',
// 'xx-small': '',
// 'x-small': '',
// 'small': '',
// 'medium': '',
// 'moderate': '',
// 'none': '',
// 'none': '',
// 'none': '',
// 'none': '',
// 'none': '',
// }
// const generateStyle = ({
// margin,
// marginX,
// marginY,
// marginTop,
// marginBottom,
// marginLeft,
// marginRight,
// padding,
// paddingX,
// paddingY,
// paddingTop,
// paddingBottom,
// paddingLeft,
// paddingRight,
// top,
// bottom,
// left,
// right,
// height,
// maxHeight,
// minHeight,
// width,
// maxWidth,
// minWidth,
// display,
// position,
// alignItems,
// justifyContent,
// flexDirection,
// flexWrap,
// flexGrow,
// flexShrink,
// overflow,
// zIndex,
// textAlign,
// }: Styles) => {
// const styles = clsx({
// 'm'
// });
// };
// const getStyleValue = (spacing: Spacing, property: keyof Style): string => {
// const row = styleTable.find((r) => r.name === spacing);
// return row ? row[property] : '';
// };
// https://www.smashingmagazine.com/2020/05/reusable-react-components-tailwind/
// https://blog.logrocket.com/build-type-safe-version-tailwind-css-sprinkles/
// https://www.hunterjennings.dev/writing/fluid-typography-configuration
// https://dev.to/mikerogers0/moving-from-tailwind-to-vanilla-er-css-2ghh
// https://www.lekoarts.de/javascript/writing-performant-css-with-vanilla-extract
Box
experimentalThe lowest level component that serves as a common foundation for the design system components
Status
readyUsed to indicate the status of a component and the framework it's available for
reviewwipreadydeprecatedexperimental
Tokens - Typography - Size
wipThe available typography tokens
text-xsfont-normaltext-slate-900
Jackdaws love my big sphinx of quartz.
text-smfont-normaltext-slate-900
Jackdaws love my big sphinx of quartz.
text-basefont-normaltext-slate-900
Jackdaws love my big sphinx of quartz.
text-xlfont-normaltext-slate-900
Jackdaws love my big sphinx of quartz.
text-2xlfont-normaltext-slate-900
Jackdaws love my big sphinx of quartz.
Tokens - Typography - Prose (article content)
reviewThe available typography tokens
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Tokens - Typography - Prose (article content)
readyThe standard prose typography used for articles and other pages
Ostendit honore
Sanguine veniet terras Iove ibat nomina
Lorem markdownum quaeque duri exterrita dextra. Ad cum nunc plurimus possis et Aeetias esse. Quae spectat moriturus decimo parcere bella sua videat, hic vidi, non deam! Nec virgo Solis cultores videri Troiae scelus est quae, sustulit alta trementia maneat.
- Et navigat nova ego regia equidem et
- Coniunx adversa palustribus
- Vulnere Combe pars lustrat morsa venae
Versato Delos et domum Antenora aetate pariter potest
Icons
wipUsed to display the specified icons
Social Share
readyInline Newsletter
readyAllows a user sign up for the newsletter.
Time and Date
readyUsed to display date and time in a specific format
h:mm - twelve-hour-timeh:mm a - twelve-hour-time-with-periodHH:mm - twenty-four-hour-timeLLLL d - month-name-with-day-numberPPP - month-name-with-ordinal-datedd/MM/yyyy - hh:mm a - date-month-year-and-twelve-hour-time-with-periodyyyy-MM-dd - date-year-month-date
Article Search
readyUsed to search articles - composes Search component
Article Preview
readyUsed to display a preview of an article
Articles - Most Recent
readyUsed to display the most recent articles
Article Header
readyUsed to display an article heading. Titles are capitalised in APA style.
All Raccoons Cheat at Poker, Animal Researchers Say
Lloyd Atkinson
Article
readyUsed to display an article
All Raccoons Cheat at Poker, Animal Researchers Say
Lloyd Atkinson
Article content slotted here
Spotted a typo or want to leave a comment?
Send feedback
Bar Chart
experimentalUsed to display bar charts of numerical data
Hello world 1: 50%Hello world 3: 40%Hello world 2: 25%Hello world 3: 10%Hello world 3: 10%
- Hello world 150%
- Hello world 340%
- Hello world 225%
- Hello world 310%
- Hello world 310%
- Apple
- Banana
- Orange
- Grape
- Grape
- Grape
- Apple
- Ripe Banana
- Orange
- Grape
- Apple
- Banana
- Orange
- Grape
Venn Diagram
experimentalUsed to display overlaps of sets of data
Breakpoint Visualiser
wipUsed for visualising responsive breakpoints during development
SMMDLGXL2XL
Grouped List
wipUsed to display a list of items with a title