https://github.com/jakejarvis/stitches-normalize
🧵 @sindresorhus's modern-normalize.css as a plug-and-play JavaScript object compatible with Stitches.
https://github.com/jakejarvis/stitches-normalize
css css-in-js normalize reset stitches
Last synced: 7 months ago
JSON representation
🧵 @sindresorhus's modern-normalize.css as a plug-and-play JavaScript object compatible with Stitches.
- Host: GitHub
- URL: https://github.com/jakejarvis/stitches-normalize
- Owner: jakejarvis
- License: mit
- Created: 2022-03-05T16:57:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T16:41:50.000Z (about 2 years ago)
- Last Synced: 2025-03-13T01:18:03.772Z (7 months ago)
- Topics: css, css-in-js, normalize, reset, stitches
- Language: TypeScript
- Homepage:
- Size: 371 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧵 stitches-normalize
[](https://www.npmjs.com/package/stitches-normalize)
[](LICENSE)@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({
// default options, see below:
systemFonts: true,
webkitPrefixes: true,
mozPrefixes: true,
}), {
// 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();
returnHello, normalized world!
;
};
```## API
### normalizeCss(options?)
#### options
Type: `object`
##### systemFonts
Type: `boolean`\
Default: `true`Include the [default system font stacks](https://github.com/sindresorhus/modern-normalize/issues/3) (sans-serif fonts for `html`, monospace fonts for `code`, `kbd`, `samp`, and `pre`.)
##### webkitPrefixes
Type: `boolean`\
Default: `true`Include non-standard WebKit compatibility rules for older Safari versions on iOS and macOS.
##### mozPrefixes
Type: `boolean`\
Default: `true`Include non-standard Mozilla compatibility rules for older Firefox versions.
## License
MIT