From 56d88734803aa7a0fd97a015d05c5fc31c494023 Mon Sep 17 00:00:00 2001 From: Bart Langelaan Date: Thu, 20 Feb 2025 17:48:53 +0100 Subject: [PATCH] Improve documentation about adding TypeScript support for the `sx` prop --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 20d54793f..c53e9acc4 100644 --- a/README.md +++ b/README.md @@ -778,17 +778,12 @@ The value provided to `sx` prop can be one of the following: To use `sx` prop on HTML element, you need to augment the `HTMLAttributes` interface. Add the following code to a file that is included in your tsconfig.json: ```ts -type Theme = { - // your theme type -}; +import { SxProp } from '@pigment-css/react'; declare global { namespace React { interface HTMLAttributes { - sx?: - | React.CSSProperties - | ((theme: Theme) => React.CSSProperties) - | ReadonlyArray React.CSSProperties)>; + sx?: SxProp; } } }