frenic / csstype

Strict TypeScript and Flow types for style based on MDN data
MIT License
1.7k stars 69 forks source link

Typescript: Update readme examples for wildcard custom properties #172

Closed schonert closed 1 year ago

schonert commented 1 year ago

I recently came around the custom properties typescript warning within JSX by adding a namespace key.

declare module 'csstype' {
  interface Properties {
    // Allow namespaced CSS Custom Properties
    [index: `--p-${string}`]: any;
  }
}
frenic commented 1 year ago

Nice, thanks! 👌