Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sanity/demo

sanity-io7.1kMIT2.0.0TypeScript support: included

Design tokens for implementing demos and templates at Sanity.io.

sanity, demo, design, tokens, guidelines, docs

readme

@sanity/demo

Design tokens and guidelines for implementing demos and templates at Sanity.io.

Installation

npm install @sanity/demo

Local development

git clone git@github.com:sanity-io/demo.git
cd demo
pnpm install
pnpm dev
# Open Vite development server

Usage

Follow these steps to configure your demo:

Installing fonts

Sanity demos use Inter, PT Serif, and IBM Plex Mono. Add this snippet inside the <head> tag of your application:

<!-- Google fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
  href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;700&family=Inter:wght@500;700;800&family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap"
  rel="stylesheet"
/>

Usage with Tailwind

// tailwind.config.js

const {theme} = require('@sanity/demo/tailwind')

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [...],
  theme,
  plugins: [require('@tailwindcss/typography')],
}

License

MIT © Sanity.io

changelog

📓 Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.0 (2024-02-21)

⚠ BREAKING CHANGES

  • deps: Update dependency @sanity/color to v3 (#43)

Bug Fixes

  • deps: Update dependency @sanity/color to v3 (#43) (e0b6cac)
  • minify bundle (e73ad26)

1.0.2 (2023-02-15)

Bug Fixes

  • deps: update dependency react-router-dom to ^6.8.1 (#16) (6465d47)

1.0.1 (2022-11-27)

Bug Fixes

  • deps: update dependencies (cd97410)

1.0.0 (2022-11-11)

Features

Bug Fixes

  • include tailwind.js (5a2a6ce)
  • reset Tailwind typography colors (19b09fd)

1.0.0-alpha.3 (2022-11-09)

Bug Fixes

  • reset Tailwind typography colors (19b09fd)

1.0.0-alpha.2 (2022-11-08)

Bug Fixes

1.0.0-alpha.1 (2022-11-08)

Features