TypeScript CSS types and value helpers generated from MDN data
MIT License
This library provides TypeScript types for CSS properties. It uses data provided by MDN to generate types. This project is similar to https://github.com/frenic/csstype, but differs in some key points:
display
propertyIt has mainly been designed to generate types which could be consumed by https://github.com/johanneslumpe/styled-props which can natively work with the generated tuple types. Maybe others will find this helpful as well.
The type generation process itself works, but doesn't yet support all CSS features. E.g. functions are aliased to string
, instead of auto-generated helper functions which return branded types.
All properties are suffixed with Property
and combined types are suffixed with Combined
, e.g. DisplayProperty
and DisplayPropertyCombined
.
npm i @johanneslumpe/css-types
TODO
Typedocs can be found in the docs folder