From b3aa918c6a03c725fe381260b2d5d0330da131a0 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sat, 5 Mar 2022 12:19:12 -0500 Subject: [PATCH] add usage example to readme --- README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13ee9c1..7d6d6ce 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,42 @@ # 🧵 stitches-normalize -**🚧 Work in progress!** +[![npm](https://img.shields.io/npm/v/stitches-normalize)](https://www.npmjs.com/package/stitches-normalize) +[![MIT License](https://img.shields.io/github/license/jakejarvis/stitches-normalize?color=violet)](LICENSE) -@sindresorhus's [modern-normalize.css](https://github.com/sindresorhus/modern-normalize) as a plug-and-play JavaScript object compatible with Stitches. +@sindresorhus's [**modern-normalize.css**](https://github.com/sindresorhus/modern-normalize) as a plug-and-play JavaScript object compatible with Stitches. + +## Install + +```sh +npm install stitches-normalize +# or... +yarn add stitches-normalize +``` + +## Usage + +This assumes you already have a `stitches.config.js` (or `.ts`) file that re-exports the `globalCss()` function generated by `createStitches()`. + +You can read more about setting that file up [in Stitches' awesome documentation](https://stitches.dev/docs/installation#create-your-config-file). + +```jsx +import { globalCss } from "./stitches.config"; +import normalizeCss from "stitches-normalize"; + +const globalStyles = globalCss(...normalizeCss, { + // you can put the rest of your global styles here if necessary. + // these rules will override stitches-normalize's. + + body: { + fontFamily: "'Comic Sans MS', sans-serif", + }, +}); + +const App = () => { + globalStyles(); + return

Hello, normalized world!

; +}; +``` ## License